summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-15 18:38:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-15 18:38:45 (GMT)
commitb7590b8845aaa93cf748a4200d0430356c55028a (patch)
tree1384b7210cbb10f2423dfb41341c6ad40f8d5892 /Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake
parentbdcde7762c71cd27fcba6dc1a3efe12fa7a09fef (diff)
parentb4fc4da903ad5c69cfbf693839ee5020c3f2ede6 (diff)
downloadCMake-b7590b8845aaa93cf748a4200d0430356c55028a.zip
CMake-b7590b8845aaa93cf748a4200d0430356c55028a.tar.gz
CMake-b7590b8845aaa93cf748a4200d0430356c55028a.tar.bz2
Merge topic 'ExternalProject-steps-refinement'
b4fc4da903 ExternalProject: Add policy CMP0114 to refine step target dependencies f5791e24c6 Tests: Match RunCMake.ExternalProject NO_DEPENDS output more strictly b637ef494c ExternalProject: Factor out an internal helper to add a step target Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5215
Diffstat (limited to 'Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake')
-rw-r--r--Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake34
1 files changed, 34 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake b/Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake
new file mode 100644
index 0000000..210edb1
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/Steps-CMP0114-Common.cmake
@@ -0,0 +1,34 @@
+include(ExternalProject)
+
+ExternalProject_Add(proj0
+ SOURCE_DIR "."
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj0-download-mark
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj0-configure-mark
+ BUILD_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj0-build-mark
+ INSTALL_COMMAND ""
+ )
+
+cmake_policy(GET CMP0114 cmp0114)
+if(cmp0114 STREQUAL "NEW")
+ set(step_targets "update;test")
+ set(independent_step_targets "")
+else()
+ set(step_targets "install;test")
+ set(independent_step_targets "download;update")
+endif()
+
+ExternalProject_Add(proj1
+ DEPENDS proj0
+ SOURCE_DIR "."
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-download-mark
+ UPDATE_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-update-mark
+ PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-patch-mark
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-configure-mark
+ BUILD_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-build-mark
+ INSTALL_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-install-mark
+ TEST_COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/proj1-test-mark
+ TEST_EXCLUDE_FROM_MAIN 1 # Along with 'STEP_TARGETS test', implies 'STEP_TARGETS install'
+ UPDATE_DISCONNECTED 1 # Along with 'STEP_TARGETS update', implies 'STEP_TARGETS download'
+ STEP_TARGETS ${step_targets}
+ INDEPENDENT_STEP_TARGETS ${independent_step_targets}
+ )