summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ExternalProject/MultiCommand.cmake
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2017-08-23 14:40:49 (GMT)
committerCraig Scott <craig.scott@crascit.com>2017-09-02 07:53:16 (GMT)
commit1561748496b10bc74adc731fd1d5e7c733034cba (patch)
tree1711de0d41fa4e7f92435b305ea0a476ca8790d4 /Tests/RunCMake/ExternalProject/MultiCommand.cmake
parentf4aa346538433f4c89a9963d74ea5d3f9bd60390 (diff)
downloadCMake-1561748496b10bc74adc731fd1d5e7c733034cba.zip
CMake-1561748496b10bc74adc731fd1d5e7c733034cba.tar.gz
CMake-1561748496b10bc74adc731fd1d5e7c733034cba.tar.bz2
ExternalProject: Prevent COMMAND from being treated as a true keyword
The known keywords for each function are obtained by scraping the documentation for lines matching a particular regular expression. In commit 8842a027 (ExternalProject: Improve documentation, 2017-07-09), the docs were overhauled and the COMMAND docs subsequently matched the regular expression when they shouldn't have. This made COMMAND appear as a true keyword, which thwarted the special handling logic elsewhere for the intended use of COMMAND arguments. This commit contains a workaround for issue #17229 to force a dependency of the patch step on the update step to ensure a predictable step order. Fixes: #17198
Diffstat (limited to 'Tests/RunCMake/ExternalProject/MultiCommand.cmake')
-rw-r--r--Tests/RunCMake/ExternalProject/MultiCommand.cmake30
1 files changed, 30 insertions, 0 deletions
diff --git a/Tests/RunCMake/ExternalProject/MultiCommand.cmake b/Tests/RunCMake/ExternalProject/MultiCommand.cmake
new file mode 100644
index 0000000..a8dbfea
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/MultiCommand.cmake
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 3.9)
+
+include(ExternalProject)
+
+# Verify COMMAND keyword is recognised after various *_COMMAND options
+ExternalProject_Add(multiCommand
+ DOWNLOAD_COMMAND "${CMAKE_COMMAND}" -E echo "download 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "download 2"
+ UPDATE_COMMAND "${CMAKE_COMMAND}" -E echo "update 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "update 2"
+ PATCH_COMMAND "${CMAKE_COMMAND}" -E echo "patch 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "patch 2"
+ CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "configure 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "configure 2"
+ BUILD_COMMAND "${CMAKE_COMMAND}" -E echo "build 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "build 2"
+ TEST_COMMAND "${CMAKE_COMMAND}" -E echo "test 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "test 2"
+ INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "install 1"
+ COMMAND "${CMAKE_COMMAND}" -E echo "install 2"
+)
+
+# Workaround for issue 17229 (missing dependency between update and patch steps)
+ExternalProject_Add_StepTargets(multiCommand NO_DEPENDS update)
+ExternalProject_Add_StepDependencies(multiCommand patch multiCommand-update)
+
+# Force all steps to be re-run by removing timestamps from any previous run
+ExternalProject_Get_Property(multiCommand STAMP_DIR)
+file(REMOVE_RECURSE "${STAMP_DIR}")
+file(MAKE_DIRECTORY "${STAMP_DIR}")