ENH: Simpler AddExternalProject configure step
This simplifies the implementation with add_external_project_step.
This commit is contained in:
parent
385eb4dea7
commit
f3ba510a65
|
@ -466,29 +466,17 @@ function(add_external_project_configure_command name)
|
||||||
# Create the working_dir for configure, build and install steps:
|
# Create the working_dir for configure, build and install steps:
|
||||||
#
|
#
|
||||||
mkdir("${working_dir}")
|
mkdir("${working_dir}")
|
||||||
add_custom_command(
|
add_external_project_step(${name} working_dir
|
||||||
OUTPUT ${sentinels_dir}/${name}-working_dir
|
COMMENT "Making directory \"${working_dir}\""
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${working_dir}
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${working_dir}
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-working_dir
|
DEPENDEES update patch
|
||||||
DEPENDS ${sentinels_dir}/${name}-update
|
DEPENDS ${file_deps}
|
||||||
${sentinels_dir}/${name}-patch
|
|
||||||
${file_deps}
|
|
||||||
VERBATIM
|
|
||||||
)
|
)
|
||||||
|
|
||||||
get_target_property(cmd ${name} AEP_CONFIGURE_COMMAND)
|
get_property(cmd_set TARGET ${name} PROPERTY AEP_CONFIGURE_COMMAND SET)
|
||||||
if(cmd STREQUAL "")
|
if(cmd_set)
|
||||||
# Explicit empty string means no configure step for this project
|
get_property(cmd TARGET ${name} PROPERTY AEP_CONFIGURE_COMMAND)
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${sentinels_dir}/${name}-configure
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-configure
|
|
||||||
WORKING_DIRECTORY ${working_dir}
|
|
||||||
COMMENT "No configure step for '${name}'"
|
|
||||||
DEPENDS ${sentinels_dir}/${name}-working_dir
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
else()
|
else()
|
||||||
if(NOT cmd)
|
|
||||||
get_target_property(cmake_command ${name} AEP_CMAKE_COMMAND)
|
get_target_property(cmake_command ${name} AEP_CMAKE_COMMAND)
|
||||||
if(cmake_command)
|
if(cmake_command)
|
||||||
set(cmd "${cmake_command}")
|
set(cmd "${cmake_command}")
|
||||||
|
@ -505,16 +493,11 @@ function(add_external_project_configure_command name)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_custom_command(
|
add_external_project_step(${name} configure
|
||||||
OUTPUT ${sentinels_dir}/${name}-configure
|
|
||||||
COMMAND ${cmd}
|
COMMAND ${cmd}
|
||||||
COMMAND ${CMAKE_COMMAND} -E touch ${sentinels_dir}/${name}-configure
|
|
||||||
WORKING_DIRECTORY ${working_dir}
|
WORKING_DIRECTORY ${working_dir}
|
||||||
COMMENT "Performing configure step for '${name}'"
|
DEPENDEES working_dir
|
||||||
DEPENDS ${sentinels_dir}/${name}-working_dir
|
|
||||||
VERBATIM
|
|
||||||
)
|
)
|
||||||
endif()
|
|
||||||
endfunction(add_external_project_configure_command)
|
endfunction(add_external_project_configure_command)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue