Boost logo

Boost-Build :

From: Samuel Krempp (krempp_at_[hidden])
Date: 2004-01-22 20:29:27


le Sunday 18 January 2004 00:09, zwin_at_[hidden] écrivit :

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

I faced the same existential problem. at first I thought I would just let my
defines live in project-root.jam, but I successfully tried the following :

path-constant MYTOPPROJ : . ;
include $(MYTOPPROJ)/config.jam ;

the way I understand it, once invoked in a directory, bjam parses jam files
in other directories and high-level rules consider paths to be relative to
the dir of the file being parsed, but 'include' is a basic jam facility and
it wont make any processing to the string by itself.

-- 
Samuel
 

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