Boost logo

Boost-Build :

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


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

        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

        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.


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at