Hi,

Me and my friend, we are porting build configuration of quite complex
project (http://trac.osgeo.org/gdal/) from hand-written makefiles (with
partial support autotools) to CMake.

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.

Trying to figure out how to organise targets I got an idea to
configure these sub-libraries as static library targets
(e.g. libgdal_cpl, libgdal_alg, libgdal_gcore, etc.) which
eventually link to single shared library (libgdal.so).
Learning CMake best practices, I stepped across an interesting
thread: "build a shared library from static libraries"

http://www.cmake.org/pipermail/cmake/2008-March/020315.html

It actually smashed my original idea :-)
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.

Is that the best option?

What would be best way to configure such complex source tree that
outputs single library?

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

Reply via email to