summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/ExternalProject.cmake2
-rw-r--r--Tests/RunCMake/FetchContent/MultiCommand-stdout.txt6
-rw-r--r--Tests/RunCMake/FetchContent/MultiCommand.cmake18
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake1
4 files changed, 26 insertions, 1 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 2b413c2..4a9809b 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -3897,7 +3897,7 @@ function(_ep_do_preconfigure_steps_now name)
# Once any step has to run, all later steps have to be run too
set(need_to_run FALSE)
- foreach(step IN ITEMS download update parse)
+ foreach(step IN ITEMS download update patch)
if(update_disconnected AND "${step}" STREQUAL "update")
continue()
endif()
diff --git a/Tests/RunCMake/FetchContent/MultiCommand-stdout.txt b/Tests/RunCMake/FetchContent/MultiCommand-stdout.txt
new file mode 100644
index 0000000..7f2c0f8
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MultiCommand-stdout.txt
@@ -0,0 +1,6 @@
+.* *download 1
+.* *download 2
+.* *update 1
+.* *update 2
+.* *patch 1
+.* *patch 2
diff --git a/Tests/RunCMake/FetchContent/MultiCommand.cmake b/Tests/RunCMake/FetchContent/MultiCommand.cmake
new file mode 100644
index 0000000..92e08e4
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MultiCommand.cmake
@@ -0,0 +1,18 @@
+include(FetchContent)
+
+# Verify COMMAND keyword is recognised after various *_COMMAND options
+FetchContent_Declare(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"
+)
+
+# Force all steps to be re-run by removing timestamps, scripts, etc. from any
+# previous run
+file(REMOVE_RECURSE "${FETCHCONTENT_BASE_DIR}/multiCommand-subbuild")
+
+set(FETCHCONTENT_QUIET FALSE)
+FetchContent_MakeAvailable(multiCommand)
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
index b497382..13013fa 100644
--- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
@@ -2,6 +2,7 @@ include(RunCMake)
unset(RunCMake_TEST_NO_CLEAN)
+run_cmake(MultiCommand)
run_cmake(MissingDetails)
run_cmake(DirectIgnoresDetails)
run_cmake(FirstDetailsWin)