Boost logo

Boost-Build :

Subject: Re: [Boost-build] Pre-built library path/names in jamroot
From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2009-09-09 06:43:28


Christian Auby wrote:
> Structure:
>
> Jamroot.jam
> Jamfile.jam
>
> Since people are compiling on different platforms the Jamroot only
> contains things such as include paths and defines.

I don't see the relation?

>
> How do I add an alias for a pre-built library so that the Jamfile can
> use it?
>
> e.g.
>
> lib xmlrpc
>>
>> <file>d:/dev/libs/xmlrpc/lib/xmlrpc.lib
> ;

Strictly speaking, the above isn't an alias in Boost.Build.

>
> this works if I put this in the Jamfile (which I can't, since the path
> won't work for other users), but it won't work if I put it in the
> Jamroot. (which is what I want since everyone could insert their own
> path)

There shouldn't be any problem defining this in the Jamroot. Examples:

1. You could keep the library inside your own project (e.g. store prebuilt
under source control):

--- Jamroot ---
path-constant PREBUILT : prebuilt/libs ;

lib xmlrpc
    :
    : <file>$(PREBUILT)/xmlrpc.lib
    ;

-------------

2. You could use an environment variable to point out the directory (or
perhaps even the library itself):

--- Jamroot ---
import os ;

path-constant PREBUILT : [ os.environ PREBUILT ] ;
# OR: path-constant XMLRPCLIB : [ os.environ XMLRPCLIB ] ;

lib xmlrpc
    :
    : <file>$(PREBUILT)/xmlrpc.lib
    # OR: <file>$(XMLRPCLIB)
    ;

-------------

Things get more complex if you need to support different OS:s, but this is
the basic idea.

HTH / Johan


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