Hi,<br><br><div class="gmail_quote">On Thu, May 17, 2012 at 11:36 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.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"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div><div>Why are you doing that? If TestB is always available as sub-dir under TestA it doesn&#39;t make much sense to also add it as a subdirectory of the parent of TestA - IMHO. Test/CMakeLists.txt can still use all targets from TestB, since target names are always valid across the complete project.</div>

</div>
<div><br></div><div>Since TestA is a submodule, it should always be present in the sources anyway.</div><span><font color="#888888"><div><br></div><div>Andreas</div></font></span></div>
</blockquote></div><br></div><div>I use functionality of TestB in Test. If TestA decides to remove TestB, then Test will break. I was trying to &quot;hide&quot; the implementation of TestA by requiring both TestA and TestB to be submodules of Test, regardless of whether or not TestA has TestB as a submodule of its own.</div>

<div><br></div><div>See what I mean?</div></blockquote><div><br></div><div>Yeah. Well, in that case I&#39;d simply check for the TestB target thats defined in TestB/CMakeLists.txt as condition for the top-levels add_subdirectory:</div>
<div><br></div><div>if(NOT TARGET TestB) </div><div>  add_subdirectory(TestB)</div><div>endif()</div><div><br></div><div>That should work.</div><div><br></div><div>Andreas</div></div>