Boost logo

Boost-Build :

From: Dario Senic (dario.senic_at_[hidden])
Date: 2007-03-26 09:10:52


Hello,

I'm starting to use boost build and I have the following problem:

I have a Jamfile in which I specify one target like this:

        exe MyExe: [ glob ./Source/*.cpp ] ;

Now, I want to specify install rule for my target but I want install
location to be different for different build variants. For example, when
building debug variant I want location to be /bin/debug and for release
variant /bin/release. The first idea was to add something like this into
Jamfile:

        install bin/debug: MyExe: <variant>debug ;
        install bin/release: MyExe: <variant>release;

But this doesn't do things exactly as I would like to. If I want to
build debug version with "bjam debug" command, because of the second
install rule release variant is also built. I want to avoid that. So
second solution I came up with was to parse command line arguments, like
this:

        import modules ;
        local argv = [ modules.peek : ARGV ] ;

        if debug in $(argv)
        {
                     install bin/debug: MyExe: <variant>debug ;
        }
        if release in $(argv)
        {
                     install bin/release: MyExe: <variant>release;
        }

But this solution is not "clean" as I would like to. For example, if I
want to build default variant with "bjam" command (with no debug/release
parameters) I have to add more logic in the code above. I would like to
avoid that because it is repetitive task I have to make for every project.

Does anybody know some better solution?
Many thanks in advance.

-- 
Dario

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