Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-02-18 02:32:25

Hi David,

davidljung wrote:
> I'm just trying to learn bjam and Boost.Build for
> my own moderate sized project (~50Klines) - which doesn't use boost.
> I've gotten it to build, but there are numerous things I can't figure
> out how to do from the various docs scattered around (and I've limited
> success at understanding the .jam sources in boost-build thus far).
> Q1: Currently, bjam builds everything in the source tree. How can I
> put something in project-root.jam (or whereever) to have everything
> built in an entirely different directory?

Top-level Jamfile can contain something like:

: build-dir /directory/of/your/choosing

> Q2: what's the best way to specify custom build options, paths etc.
> Currently I'm using variable like
> path-constant pname : /pathcomp/pathcomp
> in project-root.jam. Is that a good approach?

I think that's fine. It would be better if you could place things like that in
user-config.jam, so 'pname' is declared for all your projects, but that's not

> Q3: Some library sets allow the appropriate cflags & ldflags to be
> obtained by running shell commands like:
> pkg-config gtkmm-2.0 --cflags
> which gives (in my case):
> -I/usr/include/gtkmm-2.0 -I/usr/lib/gtkmm-2.0/include
> -I/usr/include/gtk-2.0 -I/usr/lib/sigc++-1.2/include
> -I/usr/include/sigc++-1.2 -I/usr/include/glib-2.0
> -I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include
> -I/usr/include/pango-1.0 -I/usr/X11R6/include -I/usr/include/freetype2
> -I/usr/include/atk-1.0
> is there an easy way to get that into the <includes> spec for a
> project?
> (currently, I've just hard coded it (!))
> Similarly for libraries to search & link.

No, there's no easy way. I think for a one-time run you can create a scipt
which will invoke needed tools and generate file with content like

gtkmm-2.0-properties = -I/usr/include/atk-1.0 ;

That file can be then included in Jamfile and variables used there. As for
automatically running the tools during build process -- this might turn out
to be tricky.

- Volodya


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