summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-03-22 15:15:38 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-03-22 15:15:38 (GMT)
commit2f9e6551c02d0b189732c2a798f8b6aa4afa2313 (patch)
tree55bd7c66e852d1193def8006eb631d053221e309 /Tests/RunCMake
parent88450a6ac3bd2b33d9bc4b8f97c0915d6d4ffe77 (diff)
parent9ead71df66ef41e30e75f91d059e16881c942652 (diff)
downloadCMake-2f9e6551c02d0b189732c2a798f8b6aa4afa2313.zip
CMake-2f9e6551c02d0b189732c2a798f8b6aa4afa2313.tar.gz
CMake-2f9e6551c02d0b189732c2a798f8b6aa4afa2313.tar.bz2
Merge topic 'ninja-directory-targets'
9ead71df Help: Add notes for topic 'ninja-directory-targets' e9bf8ec8 Ninja: Add test for `$subdir/all` targets ca575fe9 Ninja: Add `$subdir/all` targets
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/Ninja/SubDir-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDir.cmake2
-rw-r--r--Tests/RunCMake/Ninja/SubDir/CMakeLists.txt2
4 files changed, 21 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()
diff --git a/Tests/RunCMake/Ninja/SubDir-build-stdout.txt b/Tests/RunCMake/Ninja/SubDir-build-stdout.txt
new file mode 100644
index 0000000..e4b4662
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDir-build-stdout.txt
@@ -0,0 +1 @@
+Building InAll
diff --git a/Tests/RunCMake/Ninja/SubDir.cmake b/Tests/RunCMake/Ninja/SubDir.cmake
new file mode 100644
index 0000000..7224ec3
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDir.cmake
@@ -0,0 +1,2 @@
+add_subdirectory(SubDir)
+add_custom_target(TopFail ALL COMMAND does_not_exist)
diff --git a/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt b/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt
new file mode 100644
index 0000000..73ae431
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_custom_target(SubFail COMMAND does_not_exist)
+add_custom_target(InAll ALL COMMAND ${CMAKE_COMMAND} -E echo "Building InAll")