The default build directory works fine, however I would like to group some components:<br><br>ADD_SUBDIRECTORY (Example1 foo)<br>ADD_SUBDIRECTORY (Example2 foo)<br>ADD_SUBDIRECTORY (Example3 bar)<br>ADD_SUBDIRECTORY (Example4 bar)
<br><br>In my case I can omit the foo and bar since I don't have conflicting names in the executables/libraries in example 1 to 4. But it is &quot;nice&quot; to have the components separated already in the build dir for testing without doing a &quot;make install&quot; first.
<br><br>Since the ADD_SUBDIRECTORY(...) has nothing to do with the INSTALL(...) could this be a bug?<br><br>Thanks,<br><br>Peter.<br><br><div><span class="gmail_quote">On 10/21/06, <b class="gmail_sendername">Alan W. Irwin
</b> &lt;<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 2006-10-21 12:39+0200 Peter Visser wrote:<br><br>&gt; Hello,<br>&gt;<br>&gt; The following example works fine:<br>&gt;<br>&gt; ----<br>&gt; In the top CMakeLists.txt<br>&gt; ADD_SUBDIRECTORY (Example1)<br>&gt; ADD_SUBDIRECTORY (Example2)
<br>&gt; ----<br>&gt; In the subdirectories Example1/Example2<br>&gt; INSTALL(TARGETS Example1/Example2<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RUNTIME DESTINATION bin<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LIBRARY DESTINATION lib<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ARCHIVE DESTINATION lib
<br>&gt; )<br>&gt; -----<br>&gt; In the INSTALL both the executables Example1 and Example2 are added to the<br>&gt; bin directory<br>&gt;<br>&gt; However adding a [binary dir] to the ADD_SUBDIRECTORY(...) breaks the<br>&gt; INSTALL
<br>&gt; ----<br>&gt; In the top CMakeLists.txt<br>&gt; ADD_SUBDIRECTORY (Example1 foo)<br>&gt; ADD_SUBDIRECTORY (Example2 foo)<br>&gt; ----<br>&gt; In this case only Example2 is added to the bin directory. (Only the last
<br>&gt; occurence of the ADD_SUBDIRECTORY(...) is added)<br>&gt; Is this behaviour intentionally or do I misunderstand the [binary dir]<br>&gt; argument.<br><br>The documentation of ADD_SUBDIRECTORY definitely needs work, but my
<br>interpretation of &quot;binary_dir&quot; is it is the path of the build directory and<br>not the install directory (so it has nothing to do with your INSTALL command<br>directories). Thus your commands above are trying to map two separate
<br>subdirectories to the same &quot;foo&quot; build subdirectory, and that is probably<br>causing the issue. Try keeping the two build subdirectories separate, i.e.,<br>foo1 and foo2 (or take the default build subdirectory names as in your first
<br>working example).<br><br>Alan<br>__________________________<br>Alan W. Irwin<br><br>Astronomical research affiliation with Department of Physics and Astronomy,<br>University of Victoria (<a href="http://astrowww.phys.uvic.ca">
astrowww.phys.uvic.ca</a>).<br><br>Programming affiliations with the FreeEOS equation-of-state implementation<br>for stellar interiors (<a href="http://freeeos.sf.net">freeeos.sf.net</a>); PLplot scientific plotting software
<br>package (<a href="http://plplot.org">plplot.org</a>); the Yorick front-end to PLplot (<a href="http://yplot.sf.net">yplot.sf.net</a>); the<br>Loads of Linux Links project (<a href="http://loll.sf.net">loll.sf.net</a>); and the Linux Brochure Project
<br>(<a href="http://lbproject.sf.net">lbproject.sf.net</a>).<br>__________________________<br><br>Linux-powered Science<br>__________________________<br></blockquote></div><br>