On 09/21/2015 10:24 AM, thoni56 wrote:
Aahh, I was looking at the trace and it only included "include":s so I
thought that offending IF was in cmake's own files since it pointed there.

But, you are saying that probably the culprit is a variable set before the
first include, right? (It was definitely not by intention a variable was as
having the empty name ;-).

The culprit is the empty named variable being set before the condition in that included module is evaluated, yes.

If you aren't the one setting it it might also be accidentally set somewhere in cmake code of course.

It probably isn't something as obvious as set("" foobar) but perhaps something like e.g. set("${MY_VAR_NAME}" foobar) (where MY_VAR_NAME is an unset variable e.g. due to typo or unexpected program logic).


And if I look at
/usr/share/cmake-3.3.1/Modules/CMakeParseImplicitLinkInfo.cmake:58 I should
probably see the variable (or one that expands to include it)?

The condition in that line is:
        if("${cmd}" MATCHES "${linker_regex}")

So apparently ${cmd} expands empty (which may or may not be expected but is a distinct issue).

With old behavior cmake will therefor look for a variable with the empty name and in your case finds and expands it.

If you don't know where the empty named variable might come from I would expect cmake's new --trace-expand might be helpful.

I haven't tried it myself yet and you would have to use a nightly build though since it hasn't made it into a release yet.

Nils
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to