[cmake-developers] compile_feature test results

Brad King brad.king at kitware.com
Tue Nov 12 09:40:11 EST 2013


On 11/12/2013 06:06 AM, Nils Gladitz wrote:
> On 11/12/2013 10:34 AM, Stephen Kelly wrote:
>> I don't know why the CMAKE_CXX_COMPILE_FEATURES is not correct. Any ideas?
>>
> When I run the SystemInformation test from a regular command line I get 
> errors about mspdb100.dll missing from the cl.exe instances being launched.
> This results in missing CMAKE_CXX_COMPILE_FEATURES.
> 
> When I run it from a visual studio command prompt then the test works 
> and the variable is set.

Steve, running the compiler with execute_process is apparently
going to be quite difficult to do portably.  Running "cl" will
require launching a wrapper .bat script that loads the right
VS environment.  To do this generally will require much more of
an abstraction than _CMAKE_${lang}_CREATE_OBJECT_FILE provides
right now.

The closest we come to doing this now is in
Modules/CMakeDetermineCompilerId.cmake where for the VS and Xcode
generators we actually generate a hand-coded mini project file
and build it using the IDE.  In the other generators we just run
the compiler directly through execute_process.  Together these
approaches allow us to build the single compiler id source file
in all the generators without loading any environment.  The
compile feature tests are basically doing the same kind of tests
as the compiler id, so the same approach should work.

-Brad



More information about the cmake-developers mailing list