What is your CMake code for this &quot;diamond dependency&quot; case?<br><br><div>Is there a separate directory for each of the libs involved?</div><div><br></div><div>Whichever CMakeLists file glues them all together should be able to add_subdirectory just once on each of them.... Why do you need two add_subdirectory calls for commonLib?</div>
<div><br></div><div><br><div class="gmail_quote">On Tue, Jun 16, 2009 at 6:23 PM, Tyler Roscoe <span dir="ltr">&lt;<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</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 Tue, Jun 16, 2009 at 06:04:17PM -0400, Bill Hoffman wrote:<br>
&gt; This was never expected to work, and CMake creates &quot;bad&quot; makefiles in<br>
&gt; versions of CMake prior to this.   Basically, CMake was over-writing the<br>
&gt; makefiles as many times as the directory was there.  This causes very<br>
&gt; odd things to happen, and there were many reports of CMake is broken<br>
&gt; because of this.   It caused incorrect percent done reporting and<br>
&gt; sometimes failed to build some targets altogether.   If it was working<br>
&gt; for you, you were getting lucky (or unlucky...).<br>
<br>
</div>It does work well for us with CMake 2.6.2. I have never seen a progress<br>
report &gt; 100% or any other problems that I would attribute to this.<br>
<br>
If you can only add a particular source subdirectory once, how do you<br>
handle a &quot;diamond dependency&quot;:<br>
<br>
<br>
   myApp<br>
  /    \<br>
 /      \<br>
lib1   lib2<br>
 \      /<br>
  \    /<br>
 commonLib<br>
<br>
lib1 and lib2 both need commonLib, so they both do<br>
add_subdirectory(commonLib). I suppose you could rely on myApp to<br>
perform the add_subdirectory(), but what if I want to build just lib1 or<br>
just lib2 and not build myApp?<br>
<font color="#888888"><br>
tyler<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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/opensource/opensource.html</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/CMake_FAQ</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/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>