summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-14 19:27:46 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 16:30:49 (GMT)
commit003d10c248f3f55cea7885ac83300777d687c8a5 (patch)
treedde67099447e2bca1ad239eba0dd0c9498ae78b6 /Tests
parente47d934a5a2da9f7589c801c2c232a650e2c797e (diff)
downloadCMake-003d10c248f3f55cea7885ac83300777d687c8a5.zip
CMake-003d10c248f3f55cea7885ac83300777d687c8a5.tar.gz
CMake-003d10c248f3f55cea7885ac83300777d687c8a5.tar.bz2
Tests: Simplify VSExcludeFromDefaultBuild configuration
Create a CTEST_TEST_DEVENV variable that is set to the CMAKE_MAKE_PROGRAM used for Visual Studio 7, 8, and 9. It will always be either "devenv" or "VCExpress", and not "MSBuild". Add the VSExcludeFromDefaultBuild test only when this variable is set, and use its value as the --build-makeprogram value. More work will be needed later to restore the test on VS 10 and above when devenv is available, but this is the simplest approach for now.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index fc2d8a4..59aa59f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -45,8 +45,13 @@ configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in
# Testing
if(BUILD_TESTING)
+ set(CMAKE_TEST_DEVENV "")
if(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
set(CMAKE_TEST_MAKEPROGRAM "${CMAKE_MAKE_PROGRAM}")
+ if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio [7-9] " AND
+ NOT CMAKE_MAKE_PROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
+ set(CMAKE_TEST_DEVENV "${CMAKE_MAKE_PROGRAM}")
+ endif()
endif()
if("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32))
@@ -1616,7 +1621,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--test-command VSMidl)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
- if(NOT MSVC60 AND NOT CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]")
+ if(CMAKE_TEST_DEVENV)
# The test (and tested property) works with .sln files, so it's skipped when:
# * Using VS6, which doesn't use .sln files
# * cmake --build is set up to use MSBuild, since the MSBuild invocation does not use the .sln file
@@ -1628,7 +1633,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
"${CMake_BINARY_DIR}/Tests/VSExcludeFromDefaultBuild"
--build-config ${config}
--build-two-config
- ${build_generator_args}
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-makeprogram ${CMAKE_TEST_DEVENV}
+ --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
--build-project VSExcludeFromDefaultBuild
--test-command ${CMAKE_COMMAND}
-D "activeConfig=${config}"