Boost logo

Boost-Build :

From: Steven T. Hatton (hattons_at_[hidden])
Date: 2004-10-23 15:19:14


On Saturday 23 October 2004 07:40, Vladimir Prus wrote:
> Steven T. Hatton wrote:
> > How do I get bjam to produce the following (or equivalent) invocation?:
> >
> > g++ -ovmosg main.cc -I/code/root  -L/opt/org/osg/lib -losg -losgProducer
> >
> > The -l flags translate into files named similar to this:
> >
> >  -losgProducer ==> libosgProducer.so
> >
> > I get the -I/<path>/<to>/<include> by using expressions such as this:
> > `<include>$(OSG)/include' in the requirements block.  Likewise for the
> > -L flags.  What I haven't been able to produce are the -l flags.
>
> Declare the lib with
>
>   lib osg ;
>
> and then use it in your exe. This is documented in more detail at:
>
>   
> http://boost.org/boost-build2/doc/html/bbv2.advanced.builtins.targets.html#
>id2509201
>

Unfortunately (or fortunately) I didn't explain my situation well. I had been
using Boost.Build v1. I did figure out how to get it to compile by being
very explicit with the name of the library file. I believe the directive I
used was `<library-file>' I decided to try using the latest CVS of bjam, and
after a bit of struggle, I got it working like this:

project vmosg ;
lib osg : : <name>osg ;
lib osgProducer : : <name>osgProducer ;

exe vmosg : main.cc osg osgProducer
: <include>$(OSG)/include
<include>$(PRODUCER_INC_DIR)
<include>$(OPENTHREADS_INC_DIR)

One thing that was throwing me off was a rather lengthy warning indicating the
project-root function had been passed a null argument. It was displayed in
red in Emacs, which is the color errors (warnings are usually orange) are
typically displayed in.

I consolidated my Jamfile and project-root.jam, and everything worked.
Thanks.

-- 
Regards,
Steven
 

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