[cmake-developers] Testing Config generator expression
Brad King
brad.king at kitware.com
Thu Nov 1 11:17:56 EDT 2012
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.
-Brad
More information about the cmake-developers
mailing list