Subject: Re: [Boost-build] How to get a default value for BOOST_BUILD_PATH ?
From: Thomas Suckow (thomas.suckow_at_[hidden])
Date: 2014-02-10 11:36:58
On 02/10/2014 04:41 AM, Samuel Debionne wrote:
> I'm using Boost Build for my own project. Boost.Build is installed on my
> system using "b2 install --prefix=/somewhere/bbv2".
> This is working fine for the "hello" example.
> For a specific project, I would like to add some custom rules to the
> BBv2 path so I added a boost-build.jam at the root of the project :
> MYPROJECT_ROOT = $(.boost-build-file:D) ;
> BOOST_BUILD_PATH = $(DEFAULT_BOOST_BUILD_PATH) ;
> if ! $(MYPROJECT_ROOT)/tools/build in $(BOOST_BUILD_PATH)
> BOOST_BUILD_PATH += $(MYPROJECT_ROOT)/tools/build ;
> BOOST_BUILD = [ MATCH --boost-build=(.*) : $(ARGV) ] ;
> BOOST_BUILD ?= $(BOOST_BUILD_PATH) ;
> boost-build $(BOOST_BUILD) ;
> My question is how should I define DEFAULT_BOOST_BUILD_PATH (something
> like "../share/boost-build" relative to bjam executable path) ? Is there
> such variable predefined ? If I could avoid defining it by hand that
> would be great !
I believe what you want is something along the lines of $(self:D)/kernel
or possibly $(self:D)/../share/boost-build/kernel
I suspect this may change in the future with modular boost having moved
I would recommend moving to a format like the following, so you may add
multiple search paths.
local rule if-has-file ( file + : dir * )
local result ;
result = [ GLOB $(dir) : $(file) ] ;
return $(result:P) ;
local boost-src = [ if-has-file boost.css :
[ MATCH --boost=(.*) : $(ARGV) ]
BOOST = $(boost-src) ;
BOOST_ROOT = $(boost-src) ;
local boost-build-src = [ if-has-file bootstrap.jam :
[ MATCH --boost-build=(.*) : $(ARGV) ]
boost-build $(boost-build-src) ;
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