Boost logo

Boost-Build :

From: Claudio Pacciarini (clau3107_at_[hidden])
Date: 2005-12-30 01:21:35


Hello Reece and Vladimir,

First at all, thanks for so much for your responses, your help was
absolutely invaluable and enlightening. Very appreciated. With your comments
I was able to get the job done, at last! It was pretty depressing being
stuck at this without a clue.

Volodya, just one tiny, not critical question, regarding this code snippet:

> # Get all child Jamfiles
> local sub = [ glob */Jamfile ] ;
> # Strip filenames, getting just directories;
> sub = $(sub:D) ;
> for local s in $(sub)
> {
> build-project $(s) ;
> }

Do I just put that code inside test's Jamfile and that's it? Do I have to
import something or put anything else?
With this code, I'm getting this error:

        C:/dev/boost/tools/build/v2/util\path.jam:162: in path.join from module
path
        error: only first element may be rooted
        C:/dev/boost/tools/build/v2/build\project.jam:79: in load from module
project
        C:/dev/boost/tools/build/v2/build\project.jam:164: in project.find from
module project
        C:/dev/boost/tools/build/v2\build-system.jam:136: in load from module
build-system
        C:\dev\boost\tools\build\v2\kernel\modules.jam:259: in import from module
modules
        C:\dev\boost\tools\build\v2\kernel\bootstrap.jam:153: in boost-build from
module
        C:\dev\boost\tools\build\v2\boost-build.jam:2: in module scope from module

        C:\dev\projects\hellobeatles\test>bjam
        Jamfile:12: syntax error at keyword =
        Jamfile:12: syntax error at keyword ;
        Jamfile:20: syntax error at keyword ;
        ...found 1 target...

No big deal, just curious.
Thanks and happy holidays,

Claudio

>
>Message: 1
>Date: Wed, 28 Dec 2005 23:31:02 +0000
>From: "Reece Dunn" <msclrhd_at_[hidden]>
>Subject: Re: [Boost-build] Bjam newbie - questions.
>To: boost-build_at_[hidden]
>Message-ID: <BAY101-F32497111C9DF7CFFEFF579A0360_at_phx.gbl>
>Content-Type: text/plain; format=flowed
>
>Claudio Pacciarini wrote:
> >My latest problem:
> >
> >I have these two directories:
> >
> > test
> > test\simple
> >
> >But being inside directory 'test', when I enter bjam, I get this:
> >
> >error: Unable to find file or target named
> >error: 'boost_unit_test'
> >error: referred from project at
> >error: 'simple'
> >
> >Why is this happening? Shouldn't the lib be inherited from the parent
> >Jamfile?
>
>BB does not inherit targets from parent Jamfiles. This prevents name
>collisions. Since boost_unit_test resides in the test directory and you
>want
>to refer to it from test/simple, you need to reference it as:
>
> ..//boost_unit_test
>
>where the ".." means refer to the parent directory just like normal
>directory navigation, "//" means refer to this target and the rest is the
>target name. Anything before the "//" is treated as navigating a directory,
>so you could have:
>
> ../../test//boost_unit_test
>
>if you really wanted to. In this example, though, it doesn't make any
>difference.
>
> >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
> <variant>debug:<library>boost_test-debug.lib
> <variant>release:<library>boost_test-release.lib
> ;
>
>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.
>
> >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.
>
>HTH,
>- Reece
>
>
>
>
>------------------------------
>
>Message: 2
>Date: Thu, 29 Dec 2005 09:48:45 +0300
>From: Vladimir Prus <ghost_at_[hidden]>
>Subject: Re: [Boost-build] Bjam newbie - questions.
>To: "Boost.Build developer's and user's list"
> <boost-build_at_[hidden]>
>Message-ID: <200512290948.45611.ghost_at_[hidden]>
>Content-Type: text/plain; charset="iso-8859-1"
>
>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
> > <variant>debug:<library>boost_test-debug.lib
> > <variant>release:<library>boost_test-release.lib
> > ;
> >
> > 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) ;
> }
>
>- Volodya
>
>


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