From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-11-18 12:59:40
On Tuesday 14 November 2006 21:00, Franz wrote:
[I CC you for convenience, please reply to the list]
> I have a project with the following jamfile:
> lib a : a1.cpp a1.cpp : <define>A : : <include>./a ;
> lib b : b1.cpp b1.cpp : <define>B : : <include>./b <define>B ;
> Now I would like to "distribute" these libraries and also generate a
> a jamfile with "defines" for prebuild targets of my project which I can
> use to import from other projects. Something like this:
> lib a : : <file>liba.lib : : <include>./a ;
> lib b : : <file>libb.lib : : <include>./b <define>B ;
> My idea is to create a 'distribute' rule with handles the jamfile
> generation .
> distribute dist : a b ;
> But I don't know how I can get the usage-requirements for the libraries.
> I just get the property-set which is full of properties. Can I somehow
> get them from the file-target object? Or do I need to somehow "filter"
> the property-set?
> Here my first attempts to get the information about the library:
> class distribute-target : basic-target
> rule __init__ ( name : project : sources * )
> basic-target.__init__ $(name) : $(project) : $(sources) ;
> rule construct ( name : source-targets * : property-set )
> echo name is $(name) ;
> echo source-targets is $(source-targets) ;
> echo source-targets.name is [ $(source-targets).name ] ;
> echo source-targets.type is [ $(source-targets).type ] ;
> echo property-set is [ $(property-set).raw ] ;
> return x ;
First point to note is that you should not be defining new classes derived
from 'basic-target'. Just define some fake type and use typed target for that
type. Very soon, I'll simplify that even more.
That said, each virtual target has 'creating-subvariant' method that returns
an instance of 'subvariant' class. The latter has 'usage-requirements'
BTW, what you're doing looks rather cool!
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