|
Boost-Build : |
From: Phillip Seaver (phil_at_[hidden])
Date: 2006-04-29 15:09:20
Eoin boost.build wrote:
> path-constant /boost : Libraries/Boost/boost_1_33_1 ;
>
> This means for one of my projects relying on Boost I can use a line like
> the following;
>
> use-project /boost : $(/boost) ;
>
> This all works very satisfactorily for me, but I'd love to hear of others
> peoples setup, after all when (if?) I finish my library I'll want to make
> it as easy as possible for others to use.
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 also have platform-specific stuff (since we do work on Windows, Mac,
and Unix) that I left out here to make it simpler, but it's the same
general idea.
Phillip
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