diff options
author | Brad King <brad.king@kitware.com> | 2020-04-06 12:29:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-04-06 12:30:04 (GMT) |
commit | c18c781cb5c7c74c6f6fb8574b2aa86d98516f6d (patch) | |
tree | 8160a744618a2db97dd72c2a75d420c9928af669 | |
parent | e1f9b4fae97e176504389aa98753c2be29fc1bb1 (diff) | |
parent | 7249ba967732ba2b60189a57c5ceb9ae2776a8e5 (diff) | |
download | CMake-c18c781cb5c7c74c6f6fb8574b2aa86d98516f6d.zip CMake-c18c781cb5c7c74c6f6fb8574b2aa86d98516f6d.tar.gz CMake-c18c781cb5c7c74c6f6fb8574b2aa86d98516f6d.tar.bz2 |
Merge topic 'externalproject-patch-update-order'
7249ba9677 ExternalProject: Enforce that patch depends on update
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Ben Boeckel <ben.boeckel@kitware.com>
Merge-request: !4565
-rw-r--r-- | Modules/ExternalProject.cmake | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index a7f0411..c1ca2b5 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -2700,6 +2700,15 @@ function(_ep_add_download_command name) ) endfunction() +function(_ep_get_update_disconnected var name) + get_property(update_disconnected_set TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED SET) + if(update_disconnected_set) + get_property(update_disconnected TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED) + else() + get_property(update_disconnected DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED) + endif() + set(${var} "${update_disconnected}" PARENT_SCOPE) +endfunction() function(_ep_add_update_command name) ExternalProject_Get_Property(${name} source_dir tmp_dir) @@ -2710,12 +2719,8 @@ function(_ep_add_update_command name) get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY) get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY) get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY ) - get_property(update_disconnected_set TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED SET) - if(update_disconnected_set) - get_property(update_disconnected TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED) - else() - get_property(update_disconnected DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED) - endif() + + _ep_get_update_disconnected(update_disconnected ${name}) set(work_dir) set(comment) @@ -2877,10 +2882,17 @@ function(_ep_add_patch_command name) set(log "") endif() + _ep_get_update_disconnected(update_disconnected ${name}) + if(update_disconnected) + set(update_dep skip-update) + else() + set(update_dep update) + endif() + ExternalProject_Add_Step(${name} patch COMMAND ${cmd} WORKING_DIRECTORY ${work_dir} - DEPENDEES download + DEPENDEES download ${update_dep} ${log} ) endfunction() @@ -3031,12 +3043,7 @@ function(_ep_add_configure_command name) set(uses_terminal "") endif() - get_property(update_disconnected_set TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED SET) - if(update_disconnected_set) - get_property(update_disconnected TARGET ${name} PROPERTY _EP_UPDATE_DISCONNECTED) - else() - get_property(update_disconnected DIRECTORY PROPERTY EP_UPDATE_DISCONNECTED) - endif() + _ep_get_update_disconnected(update_disconnected ${name}) if(update_disconnected) set(update_dep skip-update) else() |