diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-11-11 05:00:49 (GMT) |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-02-02 23:40:21 (GMT) |
commit | 6dd410c2b98d5152adf69b5986b5f25d4dcd9e2a (patch) | |
tree | 049748f91b8eff7cd31a4a60fb67eaf040a0a1b1 /Tests/CMakeLists.txt | |
parent | 7eb8d9036c73784f14da9d8381023c1e26df1275 (diff) | |
download | CMake-6dd410c2b98d5152adf69b5986b5f25d4dcd9e2a.zip CMake-6dd410c2b98d5152adf69b5986b5f25d4dcd9e2a.tar.gz CMake-6dd410c2b98d5152adf69b5986b5f25d4dcd9e2a.tar.bz2 |
Ninja: Add the Ninja generator
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2c5acd9..066926a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -334,6 +334,15 @@ IF(BUILD_TESTING) --build-target car --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 @@ -341,13 +350,14 @@ IF(BUILD_TESTING) # directly in the foo sub project ADD_TEST(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test - "${CMake_SOURCE_DIR}/Tests/SubProject/foo" - "${CMake_BINARY_DIR}/Tests/SubProject/foo" + "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}" + "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}" --build-generator ${CMAKE_TEST_GENERATOR} --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-nocmake --build-project foo --build-target foo + --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo" --test-command foo ) SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) |