Boost logo

Boost-Build :

From: Phil (pbeadling_at_[hidden])
Date: 2008-06-29 12:37:13


I¹m looking for a way to configure the output of bjam so that I can builds
output depending on OS_COMPILER_VARIANT in a bin directory one above my
Jamroot. For example if bjam was invoked on an MSVC configured Windows
machine the build would be outputted to:

[Jamroot location]/../bin/windows_msvc_release

I¹ve worked out a simple way of doing this, an example is shown below which
only depends on the variant ­ but the code feels wrong; what I am assuming I
can do (but can¹t get to work) is interrogate the <target-os>, <toolset> and
<variant> keys directly from the my rule and generate a return path directly
from their values, rather than testing each key in turn to see if it equals
some predetermined value.

Googling around I can see that this may be feasible with a property_set,
using the get function, but I can¹t seem to coax the data into the form that
I need.

Could anyone point me in the right direction?

Many thanks,


>From my Jamroot:

path-constant TOP : . ;
path-constant INSTALL_ROOT : $(TOP)/../bin ;
path-constant INSTALL_RELEASE : $(INSTALL_ROOT)/release ;
path-constant INSTALL_DEBUG : $(INSTALL_ROOT)/debug ;
path-constant INSTALL_PROFILE : $(INSTALL_ROOT)/profile ;

# The below would be used as such
# install dist_lib : Libname : <conditional>@install-rule
rule install-rule ( properties * )
     local result ;
     if <variant>debug in $(properties)
     { result += <location>$(INSTALL_DEBUG) ; }
           if <variant>release in $(properties)
           { result += <location>$(INSTALL_RELEASE) ; }
                 if <variant>profile in $(properties)
                { result += <location>$(INSTALL_PROFILE) ;
   return $(result) ;

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at