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
> 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?


>>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

Faculty of Mathematics and Physics, Charles University, Prague, Czech 

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at