|
|
@@ -1990,30 +1990,38 @@ function(_ep_get_complete_stampfile name stampfile_var)
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
+function(_ep_step_add_target name step no_deps)
|
|
|
+ _ep_get_step_stampfile(${name} ${step} stamp_file)
|
|
|
+ add_custom_target(${name}-${step}
|
|
|
+ DEPENDS ${stamp_file})
|
|
|
+ set_property(TARGET ${name}-${step} PROPERTY _EP_IS_EXTERNAL_PROJECT_STEP 1)
|
|
|
+ set_property(TARGET ${name}-${step} PROPERTY LABELS ${name})
|
|
|
+ set_property(TARGET ${name}-${step} PROPERTY FOLDER "ExternalProjectTargets/${name}")
|
|
|
+
|
|
|
+ if(no_deps AND "${step}" MATCHES "^(configure|build|install|test)$")
|
|
|
+ message(AUTHOR_WARNING "Using NO_DEPENDS for \"${step}\" step might break parallel builds")
|
|
|
+ endif()
|
|
|
+
|
|
|
+ # Depend on other external projects (target-level).
|
|
|
+ if(NOT no_deps)
|
|
|
+ get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
|
|
|
+ foreach(arg IN LISTS deps)
|
|
|
+ add_dependencies(${name}-${step} ${arg})
|
|
|
+ endforeach()
|
|
|
+ endif()
|
|
|
+endfunction()
|
|
|
+
|
|
|
+
|
|
|
function(ExternalProject_Add_StepTargets name)
|
|
|
set(steps ${ARGN})
|
|
|
if(ARGC GREATER 1 AND "${ARGV1}" STREQUAL "NO_DEPENDS")
|
|
|
set(no_deps 1)
|
|
|
list(REMOVE_AT steps 0)
|
|
|
+ else()
|
|
|
+ set(no_deps 0)
|
|
|
endif()
|
|
|
foreach(step ${steps})
|
|
|
- if(no_deps AND "${step}" MATCHES "^(configure|build|install|test)$")
|
|
|
- message(AUTHOR_WARNING "Using NO_DEPENDS for \"${step}\" step might break parallel builds")
|
|
|
- endif()
|
|
|
- _ep_get_step_stampfile(${name} ${step} stamp_file)
|
|
|
- add_custom_target(${name}-${step}
|
|
|
- DEPENDS ${stamp_file})
|
|
|
- set_property(TARGET ${name}-${step} PROPERTY _EP_IS_EXTERNAL_PROJECT_STEP 1)
|
|
|
- set_property(TARGET ${name}-${step} PROPERTY LABELS ${name})
|
|
|
- set_property(TARGET ${name}-${step} PROPERTY FOLDER "ExternalProjectTargets/${name}")
|
|
|
-
|
|
|
- # Depend on other external projects (target-level).
|
|
|
- if(NOT no_deps)
|
|
|
- get_property(deps TARGET ${name} PROPERTY _EP_DEPENDS)
|
|
|
- foreach(arg IN LISTS deps)
|
|
|
- add_dependencies(${name}-${step} ${arg})
|
|
|
- endforeach()
|
|
|
- endif()
|
|
|
+ _ep_step_add_target("${name}" "${step}" "${no_deps}")
|
|
|
endforeach()
|
|
|
endfunction()
|
|
|
|
|
|
@@ -2148,7 +2156,7 @@ function(ExternalProject_Add_Step name step)
|
|
|
endif()
|
|
|
foreach(st ${step_targets})
|
|
|
if("${st}" STREQUAL "${step}")
|
|
|
- ExternalProject_Add_StepTargets(${name} ${step})
|
|
|
+ _ep_step_add_target("${name}" "${step}" "FALSE")
|
|
|
break()
|
|
|
endif()
|
|
|
endforeach()
|
|
|
@@ -2159,7 +2167,7 @@ function(ExternalProject_Add_Step name step)
|
|
|
endif()
|
|
|
foreach(st ${independent_step_targets})
|
|
|
if("${st}" STREQUAL "${step}")
|
|
|
- ExternalProject_Add_StepTargets(${name} NO_DEPENDS ${step})
|
|
|
+ _ep_step_add_target("${name}" "${step}" "TRUE")
|
|
|
break()
|
|
|
endif()
|
|
|
endforeach()
|