On Sun, May 16, 2010 at 12:48 PM, Timothy M. Shead <[email protected]> wrote:

> I'd like to do the following:
>
>  # Build external project A
>  ExternalProject_Add(A ...)
>
>  # Import target B, which is exported by A in AConfig.cmake
>  ExternalProject_Get_Property(A, BINARY_DIR)
>  set(A_DIR ${BINARY_DIR})
>  find_package(A)
>
>  # Link with B
>  add_library(C ...)
>  target_link_libraries(C B)
>
> Of course, this doesn't work because the external project hasn't been
> built yet at configure-time, so AConfig.cmake doesn't exist.  Which
> leads me to the following:
>
> Hi,

If I understand your question correctly, then adding DEPENDS A to your
ExternalProject_Add(B...) call will ensure that A has been built when B is
configured, thus satisfying your need to find A's exported targets. Using
the dependencies between external projects it is possible to control the
build order, so that A's config file will be present before B attempts a
configure step.

Hope that helps, I will take a look at this case in a moment and do some
test builds.

Thanks,

Marcus
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to