Boost logo

Boost-Build :

From: Franz (fschnyder_at_[hidden])
Date: 2006-11-14 13:00:06


Hi,

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 ;
     }

}

rule distribute ( name : targets * )
{
        for local target in $(targets)
        {
                local project = [ project.current ] ;
                targets.main-target-alternative
                        [ new distribute-target
                                  $(name)
                                : $(project)
                        : [ targets.main-target-sources $(target) : $(name) ]
                    ]
                   ;
            }
}

Thanks,

Franz
        


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