diff options
author | Brad King <brad.king@kitware.com> | 2009-03-18 15:01:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-18 15:01:02 (GMT) |
commit | 2cc46c12f8d1a9b37a24e0cdcb0f31b8a0a8d6ae (patch) | |
tree | eae24e7fe267784667bebe9799a1cf66ab5d02f0 /Modules | |
parent | 6ae0ff626a67a2a81481bf127d07543d1f0cca16 (diff) | |
download | CMake-2cc46c12f8d1a9b37a24e0cdcb0f31b8a0a8d6ae.zip CMake-2cc46c12f8d1a9b37a24e0cdcb0f31b8a0a8d6ae.tar.gz CMake-2cc46c12f8d1a9b37a24e0cdcb0f31b8a0a8d6ae.tar.bz2 |
ENH: Add patch step for add_external_project
The patch step runs parallel to the update step since it does not make
sense to have both. Configuration of the step requires specification of
a PATCH_COMMAND argument to add_external_project.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/AddExternalProject.cmake | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Modules/AddExternalProject.cmake b/Modules/AddExternalProject.cmake index b89f64e..eaf4c88 100644 --- a/Modules/AddExternalProject.cmake +++ b/Modules/AddExternalProject.cmake @@ -448,6 +448,35 @@ function(add_external_project_update_command name) endfunction(add_external_project_update_command) +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) + 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() + 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 + ) +endfunction(add_external_project_patch_command) + + function(add_external_project_configure_command name) get_external_project_directories(base_dir build_dir downloads_dir install_dir sentinels_dir source_dir tmp_dir) @@ -464,6 +493,7 @@ function(add_external_project_configure_command name) COMMAND ${CMAKE_COMMAND} -E make_directory ${working_dir} COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-working_dir DEPENDS ${sentinels_dir}/${name}-update + ${sentinels_dir}/${name}-patch ${file_deps} VERBATIM ) @@ -635,6 +665,7 @@ foreach(key IN ITEMS DOWNLOAD_COMMAND INSTALL_ARGS INSTALL_COMMAND + PATCH_COMMAND SVN_REPOSITORY SVN_TAG TAR @@ -721,6 +752,7 @@ function(add_external_project name) # add_external_project_download_command(${name}) add_external_project_update_command(${name}) + add_external_project_patch_command(${name}) add_external_project_configure_command(${name}) add_external_project_build_command(${name}) add_external_project_install_command(${name}) |