diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/BuildDepends/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt | 6 |
3 files changed, 20 insertions, 2 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 31392b5..aa32d67 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -40,6 +40,8 @@ if("${CMAKE_GENERATOR}" MATCHES "Make") endif() list(APPEND _cmake_options "-DTEST_LINK_DEPENDS=${TEST_LINK_DEPENDS}") +list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1") + file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project) message("Creating Project/foo.cxx") write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 7baed2c..c0b7cd6 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -408,6 +408,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 @@ -415,13 +424,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) diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt index c7cc090..c362e79 100644 --- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt +++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt @@ -24,6 +24,12 @@ IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") MATH(EXPR MAXPATH "${MAXPATH} - 46") ENDIF() + # Ninja imposes a maximum path component count of 30. Permit more + # path components in the source path. + IF(${CMAKE_GENERATOR} MATCHES "Ninja") + MATH(EXPR MAXPATH "${MAXPATH} - 44") + ENDIF() + # MAXPATH less 25 for last /and/deeper/simple.cxx part and small safety MATH(EXPR MAXPATH "${MAXPATH} - 25") STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN) |