From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-12-29 01:48:45
On Thursday 29 December 2005 02:31, Reece Dunn wrote:
> >What I'm trying to avoid is having to specify boost's unit test lib on
> > each test project (in this case I have only one, 'simple'). How can I do
> > this?
> You could try adding something like:
> project test : : requirements
> to the test/Jamfile. Note that I am not sure of the exact syntax, so you
> would need to refer to the www.boost.org/boost-build2 documentation. This
> works because BB inherits all project requirements from parent Jamfiles
> upto and including the first directory containing a project-root.jam file.
I am afraid that inheriting of <library> feature is currently broken, so this
won't work. What will work, however, is this (in top-level Jamfile)
lib foo ;
project test : requirements <library>/test//foo ;
Here, we use absolute id of the target, and so subproject will have no
problems accessing it.
> >Also: do I have to specify in the Jamfile inside directory 'test' each of
> >the test projects I want to build? Isn't it possible to build all sub
> >projects automatically?
> BB will only build any project dependencies. If you want to automatically
> build sample from the test directory, you will need to add:
> build-project sample ;
> which will force BB to evaluate all targets in sample/Jamfile and build any
> that are out-of-date.
It's also possible to do this:
# Get all child Jamfiles
local sub = [ glob */Jamfile ] ;
# Strip filenames, getting just directories;
sub = $(sub:D) ;
for local s in $(sub)
build-project $(s) ;
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