diff options
author | Brad King <brad.king@kitware.com> | 2009-03-30 15:37:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-30 15:37:50 (GMT) |
commit | 385eb4dea7849b0d300d642dfcb5c11016642fcd (patch) | |
tree | 06e2c3b0500a5f26733025b97fa9577324f44bfa /Modules | |
parent | aa7e41c16e10dd2c3648f0e35d4d2547b88bbd7d (diff) | |
download | CMake-385eb4dea7849b0d300d642dfcb5c11016642fcd.zip CMake-385eb4dea7849b0d300d642dfcb5c11016642fcd.tar.gz CMake-385eb4dea7849b0d300d642dfcb5c11016642fcd.tar.bz2 |
ENH: Simpler AddExternalProject patch step
This simplifies the implementation with add_external_project_step.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/AddExternalProject.cmake | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/Modules/AddExternalProject.cmake b/Modules/AddExternalProject.cmake index e3b96bd..2cd4b30 100644 --- a/Modules/AddExternalProject.cmake +++ b/Modules/AddExternalProject.cmake @@ -435,27 +435,16 @@ function(add_external_project_patch_command name) get_external_project_directories(base_dir build_dir downloads_dir install_dir sentinels_dir source_dir tmp_dir) - get_target_property(cmd ${name} AEP_PATCH_COMMAND) + set(work_dir) + get_property(cmd TARGET ${name} PROPERTY AEP_PATCH_COMMAND) if(cmd) - add_custom_command( - OUTPUT ${sentinels_dir}/${name}-patch - COMMAND ${cmd} - COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-patch - WORKING_DIRECTORY ${source_dir}/${name} - COMMENT "Performing patch step for '${name}'" - DEPENDS ${sentinels_dir}/${name}-download - VERBATIM - ) - return() + set(work_dir ${source_dir}/${name}) endif() - add_custom_command( - OUTPUT ${sentinels_dir}/${name}-patch - COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-patch - WORKING_DIRECTORY ${sentinels_dir} - COMMENT "No patch step for '${name}'" - DEPENDS ${sentinels_dir}/${name}-download - VERBATIM + add_external_project_step(${name} patch + COMMAND ${cmd} + WORKING_DIRECTORY ${work_dir} + DEPENDEES download ) endfunction(add_external_project_patch_command) |