Boost logo

Boost Users :

Subject: Re: [Boost-users] Lean and mean boost
From: Johannes Stallkamp (jstallkamp_at_[hidden])
Date: 2011-06-22 06:16:27


Hi,

Am 22.06.2011 07:58, schrieb Robert Bielik:
[...]
> I haven't just had the time to figure out how to fit that into my CMake
> workflow :)

I highly recommend the CMake macro ExternalProject_Add which is
available IIRC from CMake 2.8.3 or 2.8.4. It is able to download,
patch/update, configure, build and install projects that are not part of
your actual CMake project. It defaults to configure/build this project
with CMake, but you can even configure arbitrary commands for each step.

I have a by bootstrap script that I currently use to checkout the repo,
build external libraries from local or remote tarballs and pre-configure
my _actual_ project.

This is the important snippet that builds boost for me:

IF( BUILD_BOOST )
  IF( WIN32 )
    SET( BOOTSTRAP_EXT "bat" )
  ELSE()
    SET( BOOTSTRAP_EXT "sh" )
  ENDIF()
  SET( Boost_LIBRARY_DIR "${REPO_DIR}/trunk/org/boost/1_44_0/lib" CACHE
INTERNAL "")
  ExternalProject_Add(
    Boost
    URL ${Boost_URL}
    UPDATE_COMMAND ""
    BUILD_IN_SOURCE 1
    CONFIGURE_COMMAND "./bootstrap.${BOOTSTRAP_EXT}"
    BUILD_COMMAND bjam --layout=tagged --without-mpi --without-python
--prefix=${Boost_LIBRARY_DIR}/.. variant=release link=shared
threading=multi runtime-link=shared install
    INSTALL_COMMAND ""
  )
ELSE()
  SET( Boost_LIBRARY_DIR "" CACHE INTERNAL "" FORCE)
ENDIF()

Let me know if you need more details.

Best
Johannes


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net