Boost logo

Boost Interest :

Subject: [Boost-cmake] CMake thoughts
From: Robert Bielik (robert.bielik_at_[hidden])
Date: 2009-06-02 03:40:14


Hi,

The preliminary CMake file in the distr. (1.38.0) is IMHO way, WAY too complex. It makes no sense to have each sublib as a separate project, and in all different flavors at that (debug/rel/mt/st). It seems as it is designed just to create
the boost libraries, which in my view in a non-sensical approach of using CMake since boost is a library, not a standalone application.

The CMake file should be designed for inclusion in user CMake hierarchies, so I'd like a much more simple variant akin towards this:

project(boost)

option(BOOST_BUILD_STATIC_LIBRARY "Build Boost as STATIC library" ON)

set(BOOST_INCLUDED_LIBRARIES
  <list of all the sublibraries wanted/needed>
)

# Collect all the files needed into variable BOOST_SOURCE_FILES using the
# list from above
file(GLOB ...)

if (BOOST_BUILD_STATIC_LIBRARY)
add_library(boost STATIC ${BOOST_SOURCE_FILES})
else (BOOST_BUILD_STATIC_LIBRARY)
add_library(boost DYNAMIC ${BOOST_SOURCE_FILES})
endif (BOOST_BUILD_STATIC_LIBRARY)

This way I can easily incorporate boost into my own CMake hierarchy for creating my own projects and not clutter the
workspace with hundreds of projects all with different settings.

Just my 2 cents.

Regards
/Rob
Ps. Apologies if I'm kicking in already opened doors.


Boost-cmake list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk