<div dir="ltr">Matthew,<div><br></div><div>I tend to agree with you that 2 would not generally be a target.  However, there are external factors at play that I haven&#39;t mentioned.  For one, in our environment we&#39;d like to pull the auto generated code into a code review tool, and to mechanize that we have a commit daemon running that can run the auto generate rule, and commit the difference to a review-only branch for inspection purposes.  It&#39;s true that it could be accomplished by doing the all build, and grabbing the output after the build was complete, it just takes alot longer.  </div>

<div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div>Thomas Taranowski | 425-442-9209 | skype: thomas.taranowski | <a href="http://baringforge.com" target="_blank">baringforge.com</a><br>

<br></div>
<br><br><div class="gmail_quote">On Mon, Aug 26, 2013 at 12:36 PM, 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 15:16, Thomas Taranowski wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have the following build structure:<br>
<br>
workspace/<br>
     CMakeLists.txt # top level cmake<br>
     component_a/<br>
             CMakeLists.txt # component cmake<br>
             src/ # source in here<br>
     component_b/<br>
             CMakeLists.txt # component cmake<br>
             src/ # source in here<br>
<br>
Now, I&#39;m trying to implement a multi-stage build which does the following:<br>
1) builds some external third-party dependencies.<br>
2) auto-generate some code<br>
3) build the source<br>
4) package the result<br>
</blockquote>
<br></div>
In my experience... 1-3 and 4 are covered by the &#39;all&#39; and &#39;package&#39; targets, respectively. If your dependencies are properly expressed, I would not expect 2 to be a target, and the parts of 1 needed by 2-3 will be built automatically. (If you really want, it is trivial to add a custom target that depends on whatever third-party pieces you have.)<br>


<br>
I&#39;ve seen two common methods for dealing with third-party packages: build them in the same CMake hierarchy as everything else, or build them as external projects. In the latter case, your main project must also be an external project in order to ensure the third party pieces are fully built before the main part of your project configures.<br>


<br>
In either case, there is usually an option to use the &#39;internal&#39; version of a third-party component or to supply an external version. The main project relies on find modules / configs to find third party components, and your build driver (i.e. the root CMakeLists.txt) sets whatever variables are necessary to use or find the internal version so that the consumers thereof don&#39;t need to care about the difference.<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>
</blockquote></div><br></div>