FetchContent: Restore patch command support
The refactoring in 17e5516e60
(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.
This commit is contained in:
parent
50fc9d5b45
commit
bd876f3849
@ -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
|
# Once any step has to run, all later steps have to be run too
|
||||||
set(need_to_run FALSE)
|
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")
|
if(update_disconnected AND "${step}" STREQUAL "update")
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
|
6
Tests/RunCMake/FetchContent/MultiCommand-stdout.txt
Normal file
6
Tests/RunCMake/FetchContent/MultiCommand-stdout.txt
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.* *download 1
|
||||||
|
.* *download 2
|
||||||
|
.* *update 1
|
||||||
|
.* *update 2
|
||||||
|
.* *patch 1
|
||||||
|
.* *patch 2
|
18
Tests/RunCMake/FetchContent/MultiCommand.cmake
Normal file
18
Tests/RunCMake/FetchContent/MultiCommand.cmake
Normal file
@ -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)
|
@ -2,6 +2,7 @@ include(RunCMake)
|
|||||||
|
|
||||||
unset(RunCMake_TEST_NO_CLEAN)
|
unset(RunCMake_TEST_NO_CLEAN)
|
||||||
|
|
||||||
|
run_cmake(MultiCommand)
|
||||||
run_cmake(MissingDetails)
|
run_cmake(MissingDetails)
|
||||||
run_cmake(DirectIgnoresDetails)
|
run_cmake(DirectIgnoresDetails)
|
||||||
run_cmake(FirstDetailsWin)
|
run_cmake(FirstDetailsWin)
|
||||||
|
Loading…
Reference in New Issue
Block a user