Boost logo

Boost-Build :

Subject: Re: [Boost-build] Change default target directory for new toolset
From: Sandeep Gupta (gupta.sandeep_at_[hidden])
Date: 2010-05-25 17:02:20


On Tue, May 25, 2010 at 1:43 PM, Phillip Seaver <phil_at_[hidden]> wrote:

> On 5/25/10 4:12 PM, Sandeep Gupta wrote:
> >
> >
> > On Tue, May 25, 2010 at 10:10 AM, Belcourt, Kenneth <kbelco_at_[hidden]
> > <mailto:kbelco_at_[hidden]>> wrote:
> >
> >
> > On May 25, 2010, at 10:46 AM, Belcourt, Kenneth wrote:
> >
> > Hi Sandeep,
> >
> > On May 25, 2010, at 10:22 AM, Sandeep Gupta wrote:
> >
> > I am using boost-build to setup a experiment framework by
> > defining
> > new toolset, generators and features. It works as desired but
> > currently all builds are created within bin/debug/
> > directory. Is
> > there a way to change this to direct all builds some other
> > directory.
> >
> >
> > Wouldn't
> >
> > bjam --build-dir=some-other-directory ...
> >
> > do what you want? This option's described on page 18 of the
> > documentation.
> >
> > http://www.boost.org/doc/tools/build/doc/userman.pdf
> >
> >
> > Oh, perhaps you don't like bin/debug/...
> >
> > Then the solution is to set the build-dir option in each separate
> > Jamfile explicitly as, for example, you can see here with the
> > product name foo.
> >
> > [ Jamfile ]
> >
> > project foo
> > : requirements
> > <include>$(foo-root)/include
> > : usage-requirements
> > <include>$(foo-root)/include
> > : build-dir $(foo-builddir)
> > ;
> >
> > and in the site-config.jam or Jamroot, etc.. define the variable
> > foo-builddir so that the path you desire is set on a per product
> > basis. For example, in your Jamroot you might have
> >
> > [ Jamroot ]
> >
> > constant foo-builddir : $(builddir-arg) ;
> >
> > where builddir-arg might be the --build-dir option off the command
> > line with a suitable default if the option's not specified.
> >
> > Here's what one of our product (gtest) bin directories looks like
> > (product/version/compiler/variant/...).
> >
> >
> >
> bin/gtest/1.4.0/intel-darwin-11.1/debug/address-model-64/mpi-openmpi/
> >
> > I'm not sure if that's of any help.
> >
> >
> > -- Noel
> >
> >
> > Thanks Noel. It did solve my problem. I overlooked build-dir option,
> > partially because I kept looking for variable (per toolset ) that I
> > can set to define the output directory i.e when I say "bjam
> > toolset=mytoolset" the output directory should be mydir.
> > I guess bin/debug is hard-coded at the boost-build level.
> >
> > Appreciate so much for you looking into this. Thanks.
> > -Sandeep
>
> In my Jamroot.jam, I have:
>
> project apago : build-dir ../bbuild ;
>
> So it builds everything in a directory outside the source tree. I don't
> know if that helps you, but it avoids having to type it on the
> command-line. If the Jamroot.jam were in /usr/src, e.g., it would build
> everything in /usr/bbuild.
>
> Also, I put my "using gcc ;", etc., in my Jamroot.jam as well, depending
> on the OS I'm running on.
>
> Phillip
> _______________________________________________
>

Phillip, I have adopted your approach for now. I guess what I was asking was
since I am authoring a new toolset I should be able to define what the
default build dir should be. For many cases bin/debug wouldn't make sense.
For example while using boostbook toolset.

-Sandeep



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