[CMake] CMP0054 and CMake Modules

Nils Gladitz nilsgladitz at gmail.com
Fri Sep 25 05:58:34 EDT 2015


On 09/25/2015 11:03 AM, thoni56 wrote:
> Any idea why this only happens on Cygwin? Not on Linux or MacOSX. Is this a
> clue to something? How can I use this information to debug the issue
> further?

There are platform and compiler specific cmake modules which may only 
get processed when using cygwin.

Your project might use conditionals that only evaluate true on cygwin 
like e.g. the obvious if(CYGWIN) ... endif().

Beyond the aforementioned --trace-expand you could also try inserting 
something like the following snippet to the very top (before anything 
else) of your root-CMakeLists.txt:

	function(my_watch)
	    message("-----------------")
	    foreach(ARG ${ARGN})
	        message("[${ARG}]")
	    endforeach()
	endfunction()

	variable_watch("" my_watch)

If you do not have an explicit project() call in your 
root-CMakeLists.txt yet add one; otherwise the implicit project() call 
that cmake injects will be evaluated before the rest of your CMakeLists.txt.

It should print out locations (sadly apparently without line numbers) 
where the empty named variable is accessed.

That way you might be able to find the first file that modifies the 
empty named variable at least (probably the first with "MODIFIED_ACCESS").

Nils


More information about the CMake mailing list