Boost logo

Boost-Build :

Subject: Re: [Boost-build] Newbie questions
From: Boris Schaeling (boris_at_[hidden])
Date: 2009-07-14 15:07:30


On Mon, 13 Jul 2009 18:28:59 +0200, Steven Watanabe <watanabesj_at_[hidden]>
wrote:

> [...]
>> Then my understanding is correct that it is impossible to link to a
>> Boost C++ library without using a hardcoded path in a Jamfile? I ask as
>> I've seen sometimes variables used like BOOST_ROOT or BOOST_PATH. They
>> are not automatically inherited or set though but must have been
>> defined in a project's Jamfile?
>
> You can link to a boost library using
> /boost//iostreams (e.g.) if you have
> use-project boost : path/to/boost ;
> somewhere. It doesn't have to be in Jamroot.
> It can be in one of the configuration files.

Thanks, I see! Now I'm trying to understand how to link to prebuilt
libraries (if no Jamfiles are around). In order to keep a project's
Jamfiles platform-independent I defined the following targets in
user-config.jam:

lib boost_date_time : : <name>libboost_date_time-vc90-mt <search>C:/lib :
: <include>C:/include ;
lib boost_filesystem : : <name>libboost_filesystem-vc90-mt <search>C:/lib
: : <include>C:/include ;
...

How do I reference now these targets in my project's Jamfiles? If I simply
add boost_date_time to the sources of an exe rule bjam complains about not
finding a file or target with this name.

I also wonder if I can group the libraries somehow. If all my Boost C++
libraries can be found in C:\lib and all header files are in C:\include it
should be possible to use an alias? I tried this:

alias boost-dirs : : <search>C:/lib : : <include>C:/include ;
lib boost_date_time : boost-dirs : <name>libboost_date_time-vc90-mt ;
lib boost_filesystem : boost-dirs : <name>libboost_filesystem-vc90-mt ;

While the include directory is passed through the search directory isn't
used (compiling works but linking fails). Where do I have to put <search>?
Or do I have to use another feature?

Boris


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