Boost logo

Boost-Build :

From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2007-01-06 01:54:02


Hi,

I'd like to ask what is the recommended way, in the Boost.Build
world, to handle / configure external dependencies
required by my - BBv2-enabled - project.

This subject is related to one of my latest question about migrating GNU
autotools-based projects to BBv2. Although, here I believe the question
is more precise.

For example if there is a project of application that requires to link
against ie. PostgreSQL library - libpq, how would you write
Jamfile to make it possible for users who want to build
the application, to specify location of the libpq library and headers?

One of solution I see is to use project.extension rule to configure
external project with PostgreSQL library and then import it with 'using'
call:

using pgsql : "/usr/local/postgresql-8.2" ;

This solution is directly based on the concept I found in
bbv2-ext-tinyxml.zip, in Boost Vault (tools/build/grafik).

This seems to work, but it requires user to manually edit my Jamfile and
customize the path to PgSQL.

Another solution I know is based on project configuration file - user
only needs to edit project config file.
This solution is derived from the configuration concept presented
here by Jorge Suit Perez Ronda:

http://article.gmane.org/gmane.comp.lib.boost.build/14922

Ideally, I'd like to extend Jorge's solution and make it possible to
pass all configuration options in bjam command line, for example:

bjam --with-pgsql=/usr/local/postgresql-8.2

Unfortunately, I have no idea how to catch a custom option like
--with-pgsql in my Jamfile.
Here is what I tried so far:

if ( --with-pgsql in [ modules.peek : ARGV ] )
{
   # configure PgSQL support
}

Does it make sense?

The main problem here is how to maintain configurable options and
how to expose these options to users so they can assign appropriate values?

Cheers

-- 
Mateusz Loskot
http://mateusz.loskot.net

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