Commit bd876f38 authored by Craig Scott's avatar Craig Scott
Browse files

FetchContent: Restore patch command support

The refactoring in 17e5516e (FetchContent: Invoke steps directly and
avoid a separate sub-build, 2021-01-29) contained a typo which resulted
in any PATCH_COMMAND being ignored. Fix the typo and add a test case
that would have caught the regression.
parent 50fc9d5b
Pipeline #214762 waiting for manual action with stages
in 11 minutes and 26 seconds
......@@ -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()
......
.* *download 1
.* *download 2
.* *update 1
.* *update 2
.* *patch 1
.* *patch 2
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)
......@@ -2,6 +2,7 @@ include(RunCMake)
unset(RunCMake_TEST_NO_CLEAN)
run_cmake(MultiCommand)
run_cmake(MissingDetails)
run_cmake(DirectIgnoresDetails)
run_cmake(FirstDetailsWin)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment