summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-25 13:08:51 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-10-25 13:08:51 (GMT)
commit9430125511865b65e2fa897c59c70414238fbf91 (patch)
tree695aa78b0eeed4daf5020cd81c4aff939dcdde27 /Tests
parent9a399c27a8c6e9a264cbabf9bb3b091b2e74a71f (diff)
parent87cc9bfc3c6892c93e10f73421e2b0fdba06b8e9 (diff)
downloadCMake-9430125511865b65e2fa897c59c70414238fbf91.zip
CMake-9430125511865b65e2fa897c59c70414238fbf91.tar.gz
CMake-9430125511865b65e2fa897c59c70414238fbf91.tar.bz2
Merge topic 'ninja-subdir-binary-dir'
87cc9bfc Merge branch 'backport-ninja-subdir-binary-dir' into ninja-subdir-binary-dir e983bd32 Ninja: Use binary dir for `$subdir/all` targets 42db2ebc Ninja: Use binary dir for `$subdir/all` targets
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/Ninja/SubDir.cmake1
-rw-r--r--Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt6
6 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 446dc3c..7b4e51e 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -51,14 +51,23 @@ function(run_SubDir)
set(SubDir_all [[SubDir\all]])
set(SubDir_test [[SubDir\test]])
set(SubDir_install [[SubDir\install]])
+ set(SubDirBinary_test [[SubDirBinary\test]])
+ set(SubDirBinary_all [[SubDirBinary\all]])
+ set(SubDirBinary_install [[SubDirBinary\install]])
else()
set(SubDir_all [[SubDir/all]])
set(SubDir_test [[SubDir/test]])
set(SubDir_install [[SubDir/install]])
+ set(SubDirBinary_all [[SubDirBinary/all]])
+ set(SubDirBinary_test [[SubDirBinary/test]])
+ set(SubDirBinary_install [[SubDirBinary/install]])
endif()
run_cmake_command(SubDir-build ${CMAKE_COMMAND} --build . --target ${SubDir_all})
run_cmake_command(SubDir-test ${CMAKE_COMMAND} --build . --target ${SubDir_test})
run_cmake_command(SubDir-install ${CMAKE_COMMAND} --build . --target ${SubDir_install})
+ run_cmake_command(SubDirBinary-build ${CMAKE_COMMAND} --build . --target ${SubDirBinary_all})
+ run_cmake_command(SubDirBinary-test ${CMAKE_COMMAND} --build . --target ${SubDirBinary_test})
+ run_cmake_command(SubDirBinary-install ${CMAKE_COMMAND} --build . --target ${SubDirBinary_install})
endfunction()
run_SubDir()
diff --git a/Tests/RunCMake/Ninja/SubDir.cmake b/Tests/RunCMake/Ninja/SubDir.cmake
index d227753..11f467a 100644
--- a/Tests/RunCMake/Ninja/SubDir.cmake
+++ b/Tests/RunCMake/Ninja/SubDir.cmake
@@ -1,5 +1,6 @@
include(CTest)
add_subdirectory(SubDir)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/SubDirSource SubDirBinary)
add_custom_target(TopFail ALL COMMAND does_not_exist)
add_test(NAME TopTest COMMAND ${CMAKE_COMMAND} -E echo "Running TopTest")
install(CODE [[
diff --git a/Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt b/Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt
new file mode 100644
index 0000000..244eaa0
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirBinary-build-stdout.txt
@@ -0,0 +1 @@
+Building SubDirSourceInAll
diff --git a/Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt b/Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt
new file mode 100644
index 0000000..6b6c6dd
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirBinary-install-stdout.txt
@@ -0,0 +1 @@
+-- Installing SubDirSource
diff --git a/Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt b/Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt
new file mode 100644
index 0000000..d6d6605
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirBinary-test-stdout.txt
@@ -0,0 +1 @@
+1/1 Test #1: SubDirSourceTest
diff --git a/Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt b/Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt
new file mode 100644
index 0000000..2664261
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SubDirSource/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_custom_target(SubDirSourceFail COMMAND does_not_exist)
+add_custom_target(SubDirSourceInAll ALL COMMAND ${CMAKE_COMMAND} -E echo "Building SubDirSourceInAll")
+add_test(NAME SubDirSourceTest COMMAND ${CMAKE_COMMAND} -E echo "Running SubDirSourceTest")
+install(CODE [[
+ message(STATUS "Installing SubDirSource")
+]])