summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Ninja/RunCMakeTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/Ninja/RunCMakeTest.cmake')
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 64f97bc..4e06888 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -16,3 +16,19 @@ run_CMP0058(WARN-no)
run_CMP0058(WARN-by)
run_CMP0058(NEW-no)
run_CMP0058(NEW-by)
+
+function(run_SubDir)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SubDir-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(SubDir)
+ if(WIN32)
+ set(SubDir_all [[SubDir\all]])
+ else()
+ set(SubDir_all [[SubDir/all]])
+ endif()
+ run_cmake_command(SubDir-build ${CMAKE_COMMAND} --build . --target ${SubDir_all})
+endfunction()
+run_SubDir()