ENH: Simpler AddExternalProject patch step
This simplifies the implementation with add_external_project_step.
This commit is contained in:
parent
aa7e41c16e
commit
385eb4dea7
@ -435,27 +435,16 @@ function(add_external_project_patch_command name)
|
|||||||
get_external_project_directories(base_dir build_dir downloads_dir install_dir
|
get_external_project_directories(base_dir build_dir downloads_dir install_dir
|
||||||
sentinels_dir source_dir tmp_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)
|
if(cmd)
|
||||||
add_custom_command(
|
set(work_dir ${source_dir}/${name})
|
||||||
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()
|
endif()
|
||||||
|
|
||||||
add_custom_command(
|
add_external_project_step(${name} patch
|
||||||
OUTPUT ${sentinels_dir}/${name}-patch
|
COMMAND ${cmd}
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-patch
|
WORKING_DIRECTORY ${work_dir}
|
||||||
WORKING_DIRECTORY ${sentinels_dir}
|
DEPENDEES download
|
||||||
COMMENT "No patch step for '${name}'"
|
|
||||||
DEPENDS ${sentinels_dir}/${name}-download
|
|
||||||
VERBATIM
|
|
||||||
)
|
)
|
||||||
endfunction(add_external_project_patch_command)
|
endfunction(add_external_project_patch_command)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user