Boost logo

Boost-Build :

From: Jonathan Biggar (jon_at_[hidden])
Date: 2008-07-23 10:41:24


Jurko Gospodnetić wrote:
> Hi Jonathan.
>
>> I need to embed a path generated from the install prefix into my
>> library so it can find files at runtime. This isn't hard to do, since
>> I can use a <conditional> requirement to generate
>> <cxx-flags>-DMYPATH=... from <install-default-prefix>, but here's the
>> problem. If the user uses bjam to build the library, and then calls
>> bjam later and changes <install-default-prefix>, how do I get the
>> library to rebuild with the new -D option?
>
> My suggestion is to define a new composite, non-incidental feature.
>
> However this is not supported for 'free' features that take 'any text'
> as their value (because Boost Build currently encodes used properties
> that affect the build as path to the built target and free feature
> values would mess up that path). You would need to define a list of
> possible tag values and then convert them to exact paths inside your
> build script.

The last part is a problem, since the idea is to allow the user to build
the library and install it wherever he likes, which isn't compatible
with a preset list of feature values.

But I wonder if it's possible to declare the feature and then use
feature.extend to add the value I need on the fly (derived by converting
'/' to '-' from the user provided install path). Or even simpler, just
calculate the right value up front before declaring the feature.

I'll have to experiment and see if I can make that work.

-- 
Jon Biggar
Floorboard Software
jon_at_[hidden]
jon_at_[hidden]

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