diff options
author | Brad King <brad.king@kitware.com> | 2013-02-05 21:10:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-02-07 16:09:56 (GMT) |
commit | 56ca8d4e6365d67901e0cff7f2bd99f174537a97 (patch) | |
tree | 17473ad1dd7b67c915b53a17b0bca243b500cc45 /Tests/RunCMake | |
parent | f36c665df80e8e3f4eca0fed28b5d1c3df739552 (diff) | |
download | CMake-56ca8d4e6365d67901e0cff7f2bd99f174537a97.zip CMake-56ca8d4e6365d67901e0cff7f2bd99f174537a97.tar.gz CMake-56ca8d4e6365d67901e0cff7f2bd99f174537a97.tar.bz2 |
Tests: Add generator toolset support
Propagate CMAKE_GENERATOR_TOOLSET through the test hierarchy so that all
tests can build with the selected generator toolset, if any.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake | 10 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 4 |
3 files changed, 9 insertions, 6 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index dd150a8..320ebcc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -39,6 +39,7 @@ macro(add_RunCMake_test test) add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} -DRunCMake_GENERATOR=${CMAKE_TEST_GENERATOR} + -DRunCMake_GENERATOR_TOOLSET=${CMAKE_TEST_GENERATOR_TOOLSET} -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test} ${${test}_ARGS} diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake index 007280a..09375d9 100644 --- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake @@ -1,17 +1,17 @@ include(RunCMake) +set(RunCMake_GENERATOR_TOOLSET "") run_cmake(NoToolset) if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01]|Xcode" AND NOT XCODE_BELOW_3) - set(RunCMake_TEST_OPTIONS -T "Test Toolset") + set(RunCMake_GENERATOR_TOOLSET "Test Toolset") run_cmake(TestToolset) - unset(RunCMake_TEST_OPTIONS) else() - set(RunCMake_TEST_OPTIONS -T "Bad Toolset") + set(RunCMake_GENERATOR_TOOLSET "Bad Toolset") run_cmake(BadToolset) - unset(RunCMake_TEST_OPTIONS) endif() -set(RunCMake_TEST_OPTIONS -T "Toolset 1" "-TToolset 2") +set(RunCMake_GENERATOR_TOOLSET "") +set(RunCMake_TEST_OPTIONS -T "Extra Toolset") run_cmake(TwoToolsets) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index a43fee0..40b98d4 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -34,7 +34,9 @@ function(run_cmake test) endif() execute_process( COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}" - -G "${RunCMake_GENERATOR}" -DRunCMake_TEST=${test} + -G "${RunCMake_GENERATOR}" + -T "${RunCMake_GENERATOR_TOOLSET}" + -DRunCMake_TEST=${test} ${RunCMake_TEST_OPTIONS} WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}" OUTPUT_VARIABLE actual_stdout |