Tyler Roscoe wrote: > On Sun, Oct 11, 2009 at 08:41:27PM +0100, Mateusz Loskot wrote: >> The sources are organised in large number of subdirectories and >> sort of logical sub-libraries, but the binary output of compilation >> is a single library. > [snip] >> It looks like the best portable approach is to walk through the whole >> tree of project, collect all .c and .cpp files (assigning list of files >> to global variables) and, back in the main CMakeLists.txt, stream all >> source files to single ADD_LIBRARY call. > > This is what I would do. IME, CMake works best when you do the simplest > thing that can possibly work.
I agree, but there may be some tricks lurking. For example, does CMake promise to handle well situation when two source files with the same name but in different locations are used in common ADD_LIBRARY call, like here: ADD_LIBRARY(mylib abc/algorithm.cpp xyz/algorithm.cpp) Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake