<div class="gmail_quote">On Sun, Oct 11, 2009 at 9:01 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="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Sun, Oct 11, 2009 at 08:41:27PM +0100, Mateusz Loskot wrote:<br>
&gt; The sources are organised in large number of subdirectories and<br>
&gt; sort of logical sub-libraries, but the binary output of compilation<br>
&gt; is a single library.<br>
</div>[snip]<br>
<div class="im">&gt; It looks like the best portable approach is to walk through the whole<br>
&gt; tree of project, collect all .c and .cpp files (assigning list of files<br>
&gt; to global variables) and, back in the main CMakeLists.txt, stream all<br>
&gt; source files to single ADD_LIBRARY call.<br>
<br>
</div>This is what I would do. IME, CMake works best when you do the simplest<br>
thing that can possibly work.<br></blockquote><div><br>I would do what makes sense in terms of the end user.  If those separate subdirectories are meant to be separate libraries, then build separate libraries.  If the source code is scattered across multiple subdirectories but is all supposed to be part of the same library then build it together.<br>
<br>You can use PARENT_SCOPE to hand lists of source files up a directory, if that is of interest.<br>set(FOO_SRCS ${list_of_sources} PARENT_SCOPE)<br clear="all"></div></div><br>-- <br>Philip Lowman<br>