summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-30 15:37:50 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-30 15:37:50 (GMT)
commit385eb4dea7849b0d300d642dfcb5c11016642fcd (patch)
tree06e2c3b0500a5f26733025b97fa9577324f44bfa /Modules
parentaa7e41c16e10dd2c3648f0e35d4d2547b88bbd7d (diff)
downloadCMake-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.cmake25
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)