Boost logo

Boost-Build :

Subject: Re: [Boost-build] Referring to use-project ids from outside project directory
From: Vladimir Prus (ghost_at_[hidden])
Date: 2009-02-18 05:27:32

On Tuesday 17 February 2009 18:37:39 Anthony Foglia wrote:
> We have a bunch of libraries that we've given ids with use-project rules
> in the Jamroot. We have other projects, not under the same Jamroot,
> that need to also refer to the same target.
> In other words, with a layout like (with contents in parentheses):
> proj1
> Jamroot ( use-project /proj-libs/Math : lib/math ; )
> lib
> math
> Jamfile
> How do I refer to "/proj-libs/Math" from a proj2 in a different directory?

Well, right know you refer to that by saying "/proj-libs/Math". The namespace
of project id is flat, and the IDs are valid everywhere, or not valid. This
is likely to change in future. However, /proj-libs/Math only becomes known
when that 'use-project' is seen, and if proj2 tries to use that before proj1/Jamroot
is read, you'll get error. You can cause proj1/Jamroot to be read by use-project,

        use-project /proj1 : <whatever location> ;

> The best solution I could come up with is to rearrange proj1 to have a
> proj-libs directory and in its Jamfile define Math as an alias to
> ../lib/math.
> Is there a better way? Is there some convention for organizing the
> interface of targets that are available to use by other projects.

Is it really the case that clients of proj1 should see /proj-libs/Math directly?
If proj1 wants to expose some targets from Math as if there were a local targets,
you can use alias, e.g.

        alias some_math_lib : /proj-libs/Math//some_math_lib ;

- Volodya

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