Hi,
I can’t figure out the following situation:
Let’ suppose that I have two external projects A and B that I build with ExternalProject_Add
so that B depends on A.
In External_B.cmake
I write something like:
ExternalProject_Add(B
...
DEPENDS
A_target
)
If in SuperBuild.cmake
I write:
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/External_A.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/External_B.cmake")
then the compilation passes fine.
But if I change the order of calling these two cmake files:
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/External_B.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/External_A.cmake")
then when configuring project B I get the error telling me:
3116: error: get_property could not find TARGET A_target. Perhaps it has not yet been created.
Is there a way to setup every project dependacies and let the CMake choose the right order of configuring and building projects? Or I have to manually specify order of include(External_*.cmake)
?