Boost logo

Boost-Build :

Subject: Re: [Boost-build] creating multiple targets
From: Phillip Seaver (phil_at_[hidden])
Date: 2009-10-12 14:36:41


Stefan Zimmer wrote:
> Steven Watanabe wrote:
>
>> Use the alias rule:
>>
>> alias all : exe1 exe2 ;
>>
>> In Christ,
>> Steven Watanabe
>>
>
> Thanks, this works, but not as expected.
> All my targets ( exe1 and exe2 ) get builded. But now the executables are only in their cryptic directorys "exe1/bin/gcc...".
> I have written an install bin rule in each Jamfile, which shortens the path to $(BASE_DIR)/bin/[release or degug].
> this works fine, if I build the targets directly, but it doesn't work, with that alias rule.
> Any idea to solve this?
>
> Tanks,
> Zingel
>

You could do something like this:

    JAMFILE = [ modules.peek : JAMFILE ] ;
    local search_dirs = [ MATCH (.*)/.* : [ glob */$(JAMFILE) ] ] ;
    for local d in $(search_dirs) {
        ECHO "Will build project in" $(d) ;
        build-project $(d) ;
    }

It should build the entire project (as if you had run bjam from that
directory) for each sub-directory which has a jamfile. That may build
more than you want, but it sounds like that should work for you. The
"ECHO" is just in there so you can see what it does.

JAMFILE on my system is "[Bb]uild.jam [Jj]amfile.v2 [Jj]amfile.jam", so
it won't work if your JAMFILE is the same and your jamfiles are named
"Jamfile".

Phillip


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