ExternalProject: Always run update step with non-empty UPDATE_COMMAND
The purpose of the `update` step is to run an update on each build (subject to `UPDATE_DISCONNECTED`). This is done for version-controlled source directories. We should do it for a custom `UPDATE_COMMAND` too. In particular, when `UPDATE_DISCONNECTED` is used we expect the `skip-update` step to exist.
This commit is contained in:
parent
4f17baccad
commit
bdca68388b
|
@ -2030,6 +2030,9 @@ function(_ep_add_update_command name)
|
||||||
|
|
||||||
if(cmd_set)
|
if(cmd_set)
|
||||||
set(work_dir ${source_dir})
|
set(work_dir ${source_dir})
|
||||||
|
if(NOT "x${cmd}" STREQUAL "x")
|
||||||
|
set(always 1)
|
||||||
|
endif()
|
||||||
elseif(cvs_repository)
|
elseif(cvs_repository)
|
||||||
if(NOT CVS_EXECUTABLE)
|
if(NOT CVS_EXECUTABLE)
|
||||||
message(FATAL_ERROR "error: could not find cvs for update of ${name}")
|
message(FATAL_ERROR "error: could not find cvs for update of ${name}")
|
||||||
|
|
|
@ -21,6 +21,18 @@ set_property(DIRECTORY PROPERTY EP_BASE ${base})
|
||||||
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
|
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
|
||||||
set_property(DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS update)
|
set_property(DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS update)
|
||||||
|
|
||||||
|
ExternalProject_Add(TestUpdateCommand
|
||||||
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
UPDATE_COMMAND ${CMAKE_COMMAND} -E echo update
|
||||||
|
UPDATE_DISCONNECTED 1
|
||||||
|
CONFIGURE_COMMAND ""
|
||||||
|
BUILD_COMMAND ""
|
||||||
|
INSTALL_COMMAND ""
|
||||||
|
INDEPENDENT_STEP_TARGETS update
|
||||||
|
)
|
||||||
|
add_custom_target(TestUpdateCommandDriver ALL)
|
||||||
|
add_dependencies(TestUpdateCommandDriver TestUpdateCommand-update)
|
||||||
|
|
||||||
set(do_git_tests 0)
|
set(do_git_tests 0)
|
||||||
|
|
||||||
if(GIT_EXECUTABLE)
|
if(GIT_EXECUTABLE)
|
||||||
|
|
Loading…
Reference in New Issue