Boost logo

Boost-Build :

Subject: Re: [Boost-build] How to peek into the global module? / Name of the global module?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-02-18 09:48:45


On Thursday 18 February 2010 16:45:26 Deniz Bahadir wrote:

> I made a small mistake in the example, it should read like this:
>
>
> myVariable1 = "myVal1" ;
> constant myVariable2 : "myVal2" ;
>
> module anotherModule {
> echo "myVal1 is: " [ modules.peek <NAME_OF_GLOBAL_MODULE> : myVariable1 ] ;
> echo "myVal2 is: " [ modules.peek <NAME_OF_GLOBAL_MODULE> : myVariable2 ] ;
> }

To peek at variable in a global module you can use:

        [ modules.peek : myVariable1 ] ;

However, please note that global module is not the module where Jamroot lives.
Each project file -- including Jamroot, every Jamfile and every *-config.jam
file is a separate module. Inside such file, the name of the module can be
obtained using $(__name__)
Definitions made with 'constant' and 'path-constant' are automatically inherited
in modules of child projects. E.g. 'constant' in Jamroot will be inherited by
all Jamfiles under that Jamroot.

Hope this helps,

--
Vladimir Prus
http://vladimir_prus.blogspot.com
Boost.Build: http://boost.org/boost-build2

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