<div class="gmail_quote">On Sun, May 16, 2010 at 12:48 PM, Timothy M. Shead <span dir="ltr"><<a href="mailto:tshead@k-3d.com">tshead@k-3d.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I'd like to do the following:<br>
<br>
# Build external project A<br>
ExternalProject_Add(A ...)<br>
<br>
# Import target B, which is exported by A in AConfig.cmake<br>
ExternalProject_Get_Property(A, BINARY_DIR)<br>
set(A_DIR ${BINARY_DIR})<br>
find_package(A)<br>
<br>
# Link with B<br>
add_library(C ...)<br>
target_link_libraries(C B)<br>
<br>
Of course, this doesn't work because the external project hasn't been<br>
built yet at configure-time, so AConfig.cmake doesn't exist. Which<br>
leads me to the following:<br>
<br></blockquote><div>Hi,</div><div><br></div><div>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.</div>
<div><br></div><div>Hope that helps, I will take a look at this case in a moment and do some test builds.</div><div><br></div><div>Thanks,</div><div><br></div><div>Marcus</div></div>