<div class="gmail_quote">On Thu, Mar 5, 2009 at 7:10 PM, Bill O&#39;Hara <span dir="ltr">&lt;<a href="mailto:billtohara@gmail.com">billtohara@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br><br>I&#39;m writing a grand top-level CMakeLists.txt that delegates to a number of CMakeLists.txt in various subdirectories:<br><br>add_subdirectories(foo)<br>add_subdirectories(bar)<br><br>Is there a straightforward to get cmake to do a make install for foo before continuing on to do bar? And to prevent a parallel build from starting in bar until this is completed for foo?</blockquote>
<div><br>&quot;bar&quot; depending on the make installed form of &quot;foo&quot;?  Are you sure you want this?  If bar depends on foo you probably want to use include_directories() and target_link_libraries() to link against the compiled form of foo, not what&#39;s make installed.<br>
<br><br><br>To answer your question though one way would be to use a variable for this:<br><br>if(USE_BAR)<br>   add_subdirectory(bar)<br>endif()<br><br>cmake ..<br>make install<br>cmake -DUSE_BAR=ON ..<br>make install<br>
</div></div><br>-- <br>Philip Lowman<br>