mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
`ExternalProject_Add_StepTargets` and `INDEPENDENT_STEP_TARGETS` have some limitations and lack some sanity checks. They can cause confusing build systems to be generated. The basic problems are: * The notion of step independence is attached to the step target rather than the step itself. * The custom commands implementing the steps are duplicated in the step targets and the primary targets. This can cause races. It is also incompatible with the Xcode "new build system". Fix this by introducing policy CMP0114 to change the way step target dependencies are handled. Define independence from external dependencies as a property of each individual step regardless of whether there is a target for it. Add dependencies among the primary target and the step targets such that each custom command only appears in one target. When some steps are disconnected from the primary target, add step targets for the steps commonly depended upon so that there is a place to hold their custom commands uniquely. Fixes: #18663
18 lines
575 B
CMake
18 lines
575 B
CMake
|
|
include(ExternalProject RESULT_VARIABLE GOO)
|
|
|
|
set_property(DIRECTORY PROPERTY EP_INDEPENDENT_STEP_TARGETS download patch update configure build)
|
|
|
|
ExternalProject_Add(FOO
|
|
URL https://example.org/foo.tar.gz)
|
|
|
|
ExternalProject_Add(BAR
|
|
URL https://example.org/bar.tar.gz
|
|
TEST_COMMAND echo test
|
|
INDEPENDENT_STEP_TARGETS install)
|
|
# This one should not give a warning
|
|
ExternalProject_Add_Step(BAR bar
|
|
COMMAND echo bar)
|
|
|
|
ExternalProject_Add_StepTargets(BAR NO_DEPENDS test bar)
|