[CMake] cmake-gui leaves CMAKE_<language>_COMPILER_WORKS undefined for simple test case and CMake-2.6.4

Bill Hoffman bill.hoffman at kitware.com
Thu Jul 16 13:51:43 EDT 2009


Alan W. Irwin wrote:
> On 2009-07-15 22:54-0600 Clinton Stimpson wrote:
> 
>>
>> I don't have much to say except that ccmake behaves the same as 
>> cmake-gui in this case.
>> You can add this at the end to see it.
>> set(MYSTATUS ${CMAKE_CXX_COMPILER_WORKS} CACHE STRING "")
> 
> Thanks for pointing that out.  This can of worms just keeps getting worse
> and worse.  I have confirmed your ccmake result by looking in the resulting
> CMakeCache.txt file where (unlike the cmake result) no reference to
> CMAKE_CXX_COMPILER_WORKS appears.
> 

I am not really sure what this issue is...


This is certainly not an expected use case:

include(CMakeDetermine<language>Compiler)
before
enable_language(<language> OPTIONAL)

If you look in cmGlobalGenerator.cxx there is a big comment about how 
all the files work together to enable a language.  I am not surprised 
that including this stuff out of order is causing trouble.  I am also 
not sure why the gui's would be different...

The right thing would be to implement the OPTIONAL part.  I don't know 
if I will have time for this before 2.8 (patches are welcome...).  As a 
work around I would suggest trying to find a compiler with the same 
algorithm as CMakeDetermine does.  I can try to help you implement if 
you want...

-Bill


More information about the CMake mailing list