<div dir="ltr">Thomas, there are a lot of parallels between your scenario and the one I just posted a question about yesterday (see subject line &quot;One build, multiple compilers and packages&quot;). One of the two scenarios that Matthew suggested is the one we&#39;ve used to handle the external third party dependencies - we use ExternaProject for that. Matthew&#39;s comment that your main project then needs to be an ExternalProject as well is only partially correct though. If your main project(s) use find_library(), find_program(), etc. to work out where the external third party targets get built, then you would need to somehow ensure that the external project(s) is fully built when the main project undergoes its configure step. Making your main project an external project as well would accomplish this, but we found that making everything into a set of external projects was less than ideal (I&#39;ll save the details for that other thread if people want more info). Rather than using find_XXX() for the external third part bits, since you know where they will be in the build tree, you can instead use that knowledge and construct the necessary variables directly at configure time (which Matthew also suggested). This won&#39;t require the targets to have been built yet, but it does mean you will then have to handle any platform differences, etc. yourself (eg different library or executable prefixes and suffixes).<div>

<div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 27, 2013 at 7:36 AM, Matthew Woehlke <span dir="ltr">&lt;<a href="mailto:matthew.woehlke@kitware.com" target="_blank">matthew.woehlke@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-08-26 16:37, Thomas Taranowski wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I tend to agree with you that 2 would not generally be a target.  However,<br>
there are external factors at play that I haven&#39;t mentioned.  For one, in<br>
our environment we&#39;d like to pull the auto generated code into a code<br>
review tool, and to mechanize that we have a commit daemon running that can<br>
run the auto generate rule, and commit the difference to a review-only<br>
branch for inspection purposes.  It&#39;s true that it could be accomplished by<br>
doing the all build, and grabbing the output after the build was complete,<br>
it just takes alot longer.<br>
</blockquote>
<br></div>
In that case, you could always add another custom target that depends on all of your generated output files (as well as the targets using the same depending on them), similar to a &#39;build all third party&#39; target.<div class="HOEnZb">
<div class="h5"><br>
<br>
-- <br>
Matthew<br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/<u></u>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/<u></u>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/<u></u>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/<u></u>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<u></u>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/<u></u>listinfo/cmake</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Craig Scott<br>Melbourne, Australia
</div>