[cmake-developers] Testing Config generator expression

Stephen Kelly steveire at gmail.com
Thu Nov 1 11:45:14 EDT 2012


Brad King wrote:

> On 11/01/2012 11:06 AM, Stephen Kelly wrote:
>> RunCMake.cmake seems to use:
>> 
>>   execute_process(
>>     COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
>>               -G "${RunCMake_GENERATOR}" -DRunCMake_TEST=${test}
>> 
>> I'm not sure if I should just add API for a -
>> DCMAKE_BUILD_TYPE=${RunCMake_BUILD_TYPE} there and just limit the test
>> for this to the makefile generators?
> 
> No, the test infrastructure should not need modification for this.
> Under IDE generators the generator expression will be evaluated
> once for every configuration.  Perhaps RunCMake isn't the best
> category of tests after all.
> 
> Instead update Tests/GeneratorExpression to do
> 
>  -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG>
>  -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE>
>  ...other two configs...
> 
> Then in check.cmake verify that each variable is set to all 0s
> or all 1s.

Ok, I've added a test for that, but as that test uses CMAKE_COMMAND too, 
with makefile generators, the result will be 0000 each time.

I haven't tried the test (with or without the fix) on Windows or Mac yet.

Thanks,

Steve.




More information about the cmake-developers mailing list