summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-14 19:21:40 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 16:30:49 (GMT)
commite47d934a5a2da9f7589c801c2c232a650e2c797e (patch)
tree6281a0f7b9fe8b6a6d621f2f72c4ecf7df5ea769 /Tests
parente965cb12e2083d6b869fb30fabe7e290e6094908 (diff)
downloadCMake-e47d934a5a2da9f7589c801c2c232a650e2c797e.zip
CMake-e47d934a5a2da9f7589c801c2c232a650e2c797e.tar.gz
CMake-e47d934a5a2da9f7589c801c2c232a650e2c797e.tar.bz2
Tests: Simplify VSProjectInSubdir configuration
The test is only enabled on VS 10 and above, where the generators now select for "ctest --build-and-test" the MSBuild tool by default. Simplify the test configuration by dropping the --build-makeprogram option and all the logic needed to compute its value. The test will automatically use MSBuild.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt36
1 files changed, 11 insertions, 25 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e618f14..fc2d8a4 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1645,31 +1645,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
endif()
if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio ([0-5]|[6-9][0-9])")
- if(CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
- set(MSBUILD_EXECUTABLE "${CMAKE_TEST_MAKEPROGRAM}")
- else()
- if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio (12)")
- set(_msbuild_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\${CMAKE_MATCH_1}.0;MSBuildToolsPath]")
- else()
- set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]")
- set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]")
- set(_msbuild_hints ${_FDIR}/${_FVER})
- endif()
- find_program(MSBUILD_EXECUTABLE NAMES msbuild HINTS ${_msbuild_hints})
- endif()
- if(MSBUILD_EXECUTABLE)
- add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/VSProjectInSubdir"
- "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir"
- --build-two-config
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
- --build-makeprogram "${MSBUILD_EXECUTABLE}"
- --build-project VSProjectInSubdir
- --build-target test)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir")
- endif()
+ # This is Visual Studio 10 or above, so the default build tool is MSBuild.
+ add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/VSProjectInSubdir"
+ "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
+ --build-project VSProjectInSubdir
+ --build-target test)
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSProjectInSubdir")
endif()
endif()