Boost logo

Boost-Build :

Subject: [Boost-build] how to externally specify boost version for a library
From: Juraj Ivanèiæ (juraj.ivancic_at_[hidden])
Date: 2009-05-26 08:13:36


Hi,

I have a following scenario

project 1
---------
import boost ;

boost.use-project 1.38 ;

project myLib ;

lib myLib : aaa.cpp ... ;

project 2
---------

import boost ;

boost.use-project 1.39 ;

exe myExe : bbb.cpp ../myLib//myLib/<link>static ... ;

--------------

Both library and executable use boost libraries. For this I use
contrib/boost.jam which I find very convenient.
The problem here is that boost versions used by the lib and exe must be
the same, otherwise I get link failures when building exe. Ideally I
would like to be able to specify in the exe target that it should link
to the lib built with the same boost version - e.g. something like this:

exe myExe : ../myLib//mylib/<link>static/<boost-version>1.39

I could define boost-version feature and then use BB if-ology to include
proper headers and library path, but I would rather still somehow use
boost.jam for this purpose. This allows me to have boost library
configuration inside user-config.jam instead of having it scattered
throughout library jamfile(s).

To summarize, I would like to be able to invoke the following command
line:

bjam myLib boost-version=1.37,1.38,1.39

to get 3 versions of myLib, without having

<boost-version>x:<include>boost_x

inside myLib definition for each boost version I want supported.

Any help on how this can be accomplished is highly appreciated.

TIA,
     Juraj Ivanèiæ


Boost-Build 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