|
Boost-Build : |
From: Jim Hague (jim_at_[hidden])
Date: 2004-12-17 15:21:45
I have a project where a couple of components use a 3rd party library.
I'd like to be able to consolidate the library location into one place,
and optionally pick that location up from the environment.
So I've been fiddling about with something based on the qt module, with
an init rule that declares the library and its usage requirements.
(Imports etc. omitted for brevity).
project.initialize $(__name__) ;
project mumble ;
rule init ( prefix ? )
{
if ! $(prefix)
{
prefix = "/usr/lib/mumble" ;
}
if $(.initialized)
{
if $(prefix) != $(.prefix)
{
errors.error "Attempt to reinitialise Mumble with different
installation prefix" ;
}
}
else
{
.initialized = true ;
.prefix = $(prefix) ;
.inc-prefix = [ path.join $(prefix) "include" ] ;
.lib-prefix = [ path.join $(prefix) "lib" ] ;
local usage-requirements =
<include>$(.inc-prefix)
<dll-path>$(.lib-prefix)
<library-path>$(.lib-prefix)
;
lib libMumble : : <name>Mumble : : $(usage-requirements) ;
}
}
I then try and use this from the component Jamfile:
import toolset ;
toolset.using mumble ;
project r_va ;
exe r_va
: r_va.c
: <library>/mumble//libMumble
;
This doesn't work. bjam doesn't attempt to build anything.
If I comment out the toolset.using and the <library> line,
then bjam does attempt to build the component.
I have a nasty suspicion that I'm just trying to do this the Wrong Way,
due to a Lack Of Enlightenment. The only other way I can think of at least
consolidating the library location into one place is to have a regular
library project with a normal Jamfile (e.g. lib/Mumble/Jamfile), which does
work but I can't help feeling I'm missing something.
This is with m10. Also, on the subject of m10, is there something wrong
with dependency scanning for C files? The project builds from clean, and
rebuilds if I edit a C file, but doesn't notice if I edit a .h file,
even one included directly from a project .c file.
-- Jim Hague - jim_at_[hidden] Never trust a computer you can't lift.
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