summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-15 15:33:04 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-18 16:30:50 (GMT)
commit68031abf15affedc72c13b8b7f1ff025f510bd20 (patch)
tree9372cd59cafe186ee5044d4ea6ba89be393f2331 /Tests/CMakeLists.txt
parent003d10c248f3f55cea7885ac83300777d687c8a5 (diff)
downloadCMake-68031abf15affedc72c13b8b7f1ff025f510bd20.zip
CMake-68031abf15affedc72c13b8b7f1ff025f510bd20.tar.gz
CMake-68031abf15affedc72c13b8b7f1ff025f510bd20.tar.bz2
Tests: Configure SubProject-Stage2 test more robustly
Fix the condition that adds the test to check CMAKE_TEST_GENERATOR rather than the tools used to build CMake. Drop the test on Ninja because the generator does not support subproject generation anyway. Stop using the general build_generator_args and pass the --build-generator options explicitly. Also pass --build-makeprogram explicitly when CMAKE_TEST_MAKEPROGRAM is available because there is no CMakeCache.txt in the test project subdirectory from which to pick up the make program.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r--Tests/CMakeLists.txt25
1 files changed, 12 insertions, 13 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 59aa59f..43ae52a 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -506,8 +506,8 @@ if(BUILD_TESTING)
endif()
# test for correct sub-project generation
- # not implemented in VS6 or Xcode
- if(NOT MSVC60 AND NOT XCODE AND NOT MSVC70)
+ # not implemented in VS 6, VS 7.0, Xcode, or Ninja
+ if(NOT CMAKE_TEST_GENERATOR MATCHES "Visual Studio [67]$|Xcode|Ninja")
# run cmake and configure all of SubProject
# but only build the independent executable car
add_test(SubProject ${CMAKE_CTEST_COMMAND}
@@ -521,24 +521,23 @@ if(BUILD_TESTING)
--test-command car
)
- if(${CMAKE_TEST_GENERATOR} MATCHES "Ninja")
- # The Ninja generator does not create a recursive build system. Start
- # from the root directory.
- set(SubProject_SUBDIR)
- else()
- set(SubProject_SUBDIR "/foo")
- endif()
-
# For stage 2, do not run cmake again.
# Then build the foo sub project which should build
# the bar library which should be referenced because
# foo links to the static library bar, but bar is not
# directly in the foo sub project
+ if(CMAKE_TEST_MAKEPROGRAM)
+ set(SubProject-Stage2_BUILD_MAKEPROGRAM
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ )
+ endif()
add_test(SubProject-Stage2 ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}"
- "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}"
- ${build_generator_args}
+ "${CMake_SOURCE_DIR}/Tests/SubProject/foo"
+ "${CMake_BINARY_DIR}/Tests/SubProject/foo"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-generator-toolset "${CMAKE_TEST_GENERATOR_TOOLSET}"
+ ${SubProject-Stage2_BUILD_MAKEPROGRAM}
--build-nocmake
--build-project foo
--build-target foo