Boost logo

Boost-Build :

From: Jim Gallagher (jim_at_[hidden])
Date: 2008-08-24 10:07:36


Jurko,

>>
>> Actually, I really want the vendor path set by an environment
>> variable. How can I refer to an environment variable in a target rule,
>
> You can read environment variables by using the os.environ rule. For
>example:
>
> import os ;
> local unga-unga = [ os.environ UNGA_UNGA ] ;
> ECHO $(unga-unga) ;

This works well. And it is easier to understand than the example in
the Boost Build docs.

>
>> and how can I get the correct extension for the object file?
>
>
> alias vendor-obj : C:/vendor_install/lib/main.obj :
> <target-os>windows ;
> alias vendor-obj : /opt/vendor_path/lib/main.o :
> <target-os>unix ;
> alias vendor-obj : /opt/vendor_path/lib/main.o :
> <target-os>linux ;
>
> ###############################################
> #
> # Main build.
> #
> ###############################################
>
> exe JimTest : [ glob *.cpp ] [ glob *.c ]
> ..//MyLib
> vendor-obj ;
>

This also works, thanks. I would really like the unga-unga setting and alias
available to the subprojects. When I add this code to the Jamroot file, the
subprojects do not inherit the unga-unga setting, nor the vendor-obj alias.
How can I define these things in the Jamroot file so that subprojects
pick them up?

Thanks for your help,
Jim


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