diff options
author | Brad King <brad.king@kitware.com> | 2016-08-10 15:15:55 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-08-10 15:15:55 (GMT) |
commit | e01c576338ae448d9cbf18cc065567fde5c89f3b (patch) | |
tree | 746365b513449a7f40add5a3c0da42fc8eb3f9ea /Tests | |
parent | 627ffb4bd768609019014828d7480c22997cda0c (diff) | |
parent | 0278989405eea53ca7e5f1bfa6af9aea7a0b49c5 (diff) | |
download | CMake-e01c576338ae448d9cbf18cc065567fde5c89f3b.zip CMake-e01c576338ae448d9cbf18cc065567fde5c89f3b.tar.gz CMake-e01c576338ae448d9cbf18cc065567fde5c89f3b.tar.bz2 |
Merge topic 'ninja-directory-targets'
02789894 Ninja: Add `$subdir/{test,install,package}` targets
a88c99f1 Ninja: Simplify computation of GLOBAL_TARGET outputs
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/Ninja/RunCMakeTest.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/SubDir-install-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/SubDir-test-stdout.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/SubDir.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/SubDir/CMakeLists.txt | 4 |
5 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index c73f852..622c327 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -41,10 +41,16 @@ function(run_SubDir) run_cmake(SubDir) if(WIN32) set(SubDir_all [[SubDir\all]]) + set(SubDir_test [[SubDir\test]]) + set(SubDir_install [[SubDir\install]]) else() set(SubDir_all [[SubDir/all]]) + set(SubDir_test [[SubDir/test]]) + set(SubDir_install [[SubDir/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}) endfunction() run_SubDir() diff --git a/Tests/RunCMake/Ninja/SubDir-install-stdout.txt b/Tests/RunCMake/Ninja/SubDir-install-stdout.txt new file mode 100644 index 0000000..4261b0e --- /dev/null +++ b/Tests/RunCMake/Ninja/SubDir-install-stdout.txt @@ -0,0 +1 @@ +-- Installing SubDir diff --git a/Tests/RunCMake/Ninja/SubDir-test-stdout.txt b/Tests/RunCMake/Ninja/SubDir-test-stdout.txt new file mode 100644 index 0000000..9c493ac --- /dev/null +++ b/Tests/RunCMake/Ninja/SubDir-test-stdout.txt @@ -0,0 +1 @@ +1/1 Test #1: SubDirTest diff --git a/Tests/RunCMake/Ninja/SubDir.cmake b/Tests/RunCMake/Ninja/SubDir.cmake index 7224ec3..d227753 100644 --- a/Tests/RunCMake/Ninja/SubDir.cmake +++ b/Tests/RunCMake/Ninja/SubDir.cmake @@ -1,2 +1,7 @@ +include(CTest) add_subdirectory(SubDir) add_custom_target(TopFail ALL COMMAND does_not_exist) +add_test(NAME TopTest COMMAND ${CMAKE_COMMAND} -E echo "Running TopTest") +install(CODE [[ + message(FATAL_ERROR "Installing Top") +]]) diff --git a/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt b/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt index 73ae431..456c1db 100644 --- a/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt +++ b/Tests/RunCMake/Ninja/SubDir/CMakeLists.txt @@ -1,2 +1,6 @@ add_custom_target(SubFail COMMAND does_not_exist) add_custom_target(InAll ALL COMMAND ${CMAKE_COMMAND} -E echo "Building InAll") +add_test(NAME SubDirTest COMMAND ${CMAKE_COMMAND} -E echo "Running SubDirTest") +install(CODE [[ + message(STATUS "Installing SubDir") +]]) |