diff options
author | Brad King <brad.king@kitware.com> | 2014-09-05 19:40:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-09-10 15:21:50 (GMT) |
commit | 09ab207c668deadea3635a20812fa2f478c17f9f (patch) | |
tree | 7c3bdee26a650942d2659573d523752daa1e964a /Tests/RunCMake | |
parent | 6944997bd6aa69fdf88f8e4e154e68d57195b20b (diff) | |
download | CMake-09ab207c668deadea3635a20812fa2f478c17f9f.zip CMake-09ab207c668deadea3635a20812fa2f478c17f9f.tar.gz CMake-09ab207c668deadea3635a20812fa2f478c17f9f.tar.bz2 |
Tests: Add generator platform support
Propagate CMAKE_GENERATOR_PLATFORM through the test hierarchy so that all
tests can build with the selected generator platform, if any.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake | 7 | ||||
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/include_external_msproject/check_utils.cmake | 4 |
4 files changed, 8 insertions, 5 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index d52a2b6..6735fe2 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -4,6 +4,7 @@ macro(add_RunCMake_test test) add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} -DRunCMake_GENERATOR=${CMAKE_GENERATOR} + -DRunCMake_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM} -DRunCMake_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET} -DRunCMake_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}/${test} -DRunCMake_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/${test} diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake index 442eb9f..89cc712 100644 --- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake @@ -1,13 +1,12 @@ include(RunCMake) +set(RunCMake_GENERATOR_PLATFORM "") run_cmake(NoPlatform) if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[0124])( 20[0-9][0-9])?$") - set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=x64") + set(RunCMake_GENERATOR_PLATFORM "x64") run_cmake(x64Platform) - unset(RunCMake_TEST_OPTIONS) else() - set(RunCMake_TEST_OPTIONS "-DCMAKE_GENERATOR_PLATFORM=Bad Platform") + set(RunCMake_GENERATOR_PLATFORM "Bad Platform") run_cmake(BadPlatform) - unset(RunCMake_TEST_OPTIONS) endif() diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 2020356..abc3e3d 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -53,6 +53,7 @@ function(run_cmake test) execute_process( COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}" -G "${RunCMake_GENERATOR}" + "-DCMAKE_GENERATOR_PLATFORM=${RunCMake_GENERATOR_PLATFORM}" -T "${RunCMake_GENERATOR_TOOLSET}" -DRunCMake_TEST=${test} --no-warn-unused-cli diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake index 7f5ef53..408cadb 100644 --- a/Tests/RunCMake/include_external_msproject/check_utils.cmake +++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake @@ -80,7 +80,9 @@ function(check_project test name guid type platform) set(type 8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942) endif() if(NOT platform) - if("${RunCMake_GENERATOR}" MATCHES "Win64") + if(RunCMake_GENERATOR_PLATFORM) + set(platform "${RunCMake_GENERATOR_PLATFORM}") + elseif("${RunCMake_GENERATOR}" MATCHES "Win64") set(platform "x64") else() set(platform "Win32") |