Boost logo

Boost-Build :

From: Malcolm Cifuentes (malcolm_cifuentes_at_[hidden])
Date: 2005-05-30 11:56:28


Goal: change the location used by the install target in bbv2 to represent
the structure used in the bin location or any other location I so
desire...

Since I have not seen anything like this posted previously and my
questions have been ignored I have taken the liberty of posting my
results, hope some one finds it useful.

I think it would be nice if the supplied install rule allowed for this
behaviour out of the box:)

full source @ http://www.crystalclearsoftware.com/cgi-
bin/boost_wiki/wiki.pl?Boost.Build_V2/ExtendingInstallRule

output structure created by the Jamfile below

dist3/a.lib
root/borland/debug/a.lib
borland/horay/a.lib
tool/var/horay/a.dll

The extended-install rule provides all the functionality of install
(surprise) with the ability to :

1. invoke a new feature <location-root> which invokes the same logic
used to create the bin structure but under the <location-root>
structure.
2. provide a rule that defines a location for the install, this rule
overrides the default rule supplied with extended-install

---------------Jamfile---------------------------------------------------
import extended-install ;
import property-set ;

# a rule for defining the location of the install files
rule custom-install-location ( property-set )
{
local toolset = [ $(property-set).get <toolset> ] ;

local location = $(toolset)/horay ;
local rawps = [ extended-install.refine [ $(property-set).raw ] :
$(location:G=<location>) ] ;

return [ property-set.create $(rawps) ] ;
}

# another rule for defining the location of the install files
rule custom-install-location2 ( property-set )
{
local location = tool/var/horay ;
local rawps = [ extended-install.refine [ $(property-set).raw ] :
$(location:G=<location>) ] ;

return [ property-set.create $(rawps) ] ;
}

lib a : a.cpp ;

extended-install dist3 : a : ;
extended-install dist2 : a : <location>./otherlibs ;
extended-install dist1 : a : <location-root>root ;
extended-install dist4 : a : <location-root>ignoredbymyrule :
: custom-install-location ;
extended-install dist5 : a : : : custom-install-location2 ;

---------------Jamfile End-----------------------------------------------

 


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