ExternalProject: Failed to set dependency on mkdir step
When you want to download one project into the other, you want to make sure that you do that after all directories are created. That can be achieved by setting a dependency on 'mkdir' step. The sample code is below
ExternalProject_Add(mytarget-subtarget1
GIT_REPOSITORY <repo1>
SOURCE_DIR "${CMAKE_BINARY_DIR}/src/subdir"
STEP_TARGETS mkdir download
EXCLUDE_FROM_ALL TRUE
)
ExternalProject_Add(mytarget
GIT_REPOSITORY repo2
SOURCE_DIR "${CMAKE_BINARY_DIR}/src"
STEP_TARGETS download
)
ExternalProject_Add_StepDependencies(mytarget-subtarget1 mkdir mytarget-download)
Unfortunately dependency on mkdir doesn't work due to a bug in ExternalProject module
Edited by Brad King