Boost logo

Boost-Build :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2006-05-16 07:52:25

Phillip Seaver wrote:


> You can just put the "use-project" lines in your Jamroot. I was doing
> things like "use-project boost : misc/boost ;" in my Jamroot, then any
> of the projects that needed boost would just use "/boost" in their
> sources. Now my setup is slightly more flexible. I've got "libs",
> "misc", and "progs" dirs under the directory with my Jamroot.jam file.
> Each of those sub-directories has project (lib or exe) directories
> under
> them with a "build.jam" file. In Jamroot.jam, I have code like this:
> local JAMFILE = build.jam ;
> local sub_dirs = [ MATCH .*/(.*)/.* : [ glob */* ] ] ;
> local search_dirs = [ MATCH .*/(.*/.*)/.* : [ glob
> $(sub_dirs)/*/$(JAMFILE) ] ] ;
> for local d in $(search_dirs) {
> local p = [ MATCH .*/(.*) : $(d) ] ;
> use-project /$(p) : $(d) ;
> }
> So, each directory (like misc/tiff) that has a build.jam file in it
> gets
> loaded as a project with the name of the directory. E.g. misc/tiff
> will
> get loaded as /tiff and can be referred to from any other project as
> /tiff. This lets me add new projects without having to manually add
> them to the Jamroot.jam, and projects can be moved around (within
> limits, of course) without having to modify the projects that use
> them.

I'm doing basically the same thing, and it works fine when I invoke the
build from the root. However, if I traverse the project tree down to a
specific sub-project and invoke bjam I get an error like the following:

error: Unable to find file or target named
error: '/mylib'
error: referred from project at
error: 'myapp'

Could you try to reproduce this? One difference that I can spot from your
example is that I also invoke the build-project rule for all found projects.

// Johan

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