Boost logo

Boost-Build :

From: Zbynek Winkler (zwin_at_[hidden])
Date: 2004-01-17 18:09:49


Vladimir Prus wrote:
>>So - what is the scope of a variable set in a file imported into
>>project-root.jam?
>
> If you do "import foobar " then variables in foorbar.jam are local to the
> module where they are declared -- in this case, to module 'foobar'. If you
> "include foobar", then it's just textual inclusion and they are local to the
> module which includes foobar.
>
The problem with "include" is that it seems to be searching for the file
to be included in the current directory while "import" searches the dir
where is the Jamfile doing the import. Thus import finds it while
include doesn't :(. So, am I stuck with poke/peek?

Zbynek

>
>>How do I make a global variable?
>
>
> First, you can set variable at global module via
>
> modules.poke : VAR : some-value ;
>
> and later get it's value via
>
> modules.peek : VAR
>
> That's somewhat inconvenient. OTOH, if you change "import user-settings.jam"
> to "include user-settings.jam", you'll be able to use 'constant' in
> user-settings.jam.
>
> HTH,
> Volodya

-- 
http://zw.matfyz.cz/ http://robotika.cz/
Faculty of Mathematics and Physics, Charles University, Prague, Czech 
Republic
 

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