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 "nice" to have the components separated already in the build dir for testing without doing a "make install" 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> <<a href="mailto:irwin@beluga.phys.uvic.ca">irwin@beluga.phys.uvic.ca</a>> 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>> Hello,<br>><br>> The following example works fine:<br>><br>> ----<br>> In the top CMakeLists.txt<br>> ADD_SUBDIRECTORY (Example1)<br>> ADD_SUBDIRECTORY (Example2)
<br>> ----<br>> In the subdirectories Example1/Example2<br>> INSTALL(TARGETS Example1/Example2<br>> RUNTIME DESTINATION bin<br>> LIBRARY DESTINATION lib<br>> ARCHIVE DESTINATION lib
<br>> )<br>> -----<br>> In the INSTALL both the executables Example1 and Example2 are added to the<br>> bin directory<br>><br>> However adding a [binary dir] to the ADD_SUBDIRECTORY(...) breaks the<br>> INSTALL
<br>> ----<br>> In the top CMakeLists.txt<br>> ADD_SUBDIRECTORY (Example1 foo)<br>> ADD_SUBDIRECTORY (Example2 foo)<br>> ----<br>> In this case only Example2 is added to the bin directory. (Only the last
<br>> occurence of the ADD_SUBDIRECTORY(...) is added)<br>> Is this behaviour intentionally or do I misunderstand the [binary dir]<br>> argument.<br><br>The documentation of ADD_SUBDIRECTORY definitely needs work, but my
<br>interpretation of "binary_dir" 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 "foo" 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>