Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost-user] bjam and env var
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-10-03 02:36:40


Gennadiy Rozental wrote:

>> http://www.boost.org/boost-build2/doc/html/bbv2/faq/envar.html
>>
>> - Volodya
>
> How about complete 3rd party setup? What If I need to specify include path
> library path, libraries to link with list and set of defines?

You'd need 4 environment variables and a lib target in our project that will
use those variables to define things. Alternatively, you can declare a library
target in user-config.jam, something like this:

        project user-config ;
        
        lib third_party
                : # sources
                : # requirements
                  <name>third_party <search>some-library-path
                : # default build
                : # usage requirements
                  <include>some-include-path <define>some-define
                ;

and you can refer to this from your project using

        /user-config//third_party

notation. More complex, but unlimately best approach is creating
file third_party.jam, with the following content:

        project.initialize $(__name__) ;
        project third_party ;

        rule init ( name : library-path : include-path : defines * )
        {
                lib third_party
                : # sources
                : # requirements
                  <name>$(name) <search>$(library-path)
                : # default build
                : # usage requirements
                  <include>$(include-path) <define>$(defines)
                ;
        }

and add

        using third_party : .... ;

to user-config.jam and refer to this library as

        /third_party//third_party

The last approach is better because the 'init' rule can do smart things --
like adding some defines automatically, or accepting just 'install root'
and computing library paths and includes paths from that, etc.

Does this answer your question?

- Volodya


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net