Boost logo

Boost-Build :

From: Phillip Seaver (phil_at_[hidden])
Date: 2006-01-12 07:38:50


Reece Dunn wrote:

>Phillip Seaver wrote:
>
>
>>I'd like to be able to automatically add projects when their directories
>>exist. The reason is that we'd like to be able to not require having
>>our entire source tree in order to build any project. What I tried is:
>>
>>local sub_dirs = [ sequence.transform path.parent : [ path.glob * :
>>Jamfile ] ] ;
>>for local d in $(sub_dirs) {
>> use-project /$(d) : $(d) ;
>>}
>>[...]
>>I put the above code (with "sub_dirs" in it) into the Jamfile in "libs"
>>and tried "exe z : z.c /a//y" in "b" but it said that it couldn't find
>>"/a//y".
>>
>>What am I doing wrong? Is there a better way to do it?
>>
>>
>
>Try:
> use-project ./$(d) : $(d) ;
>or even:
> use-project $(d) : $(d) ;
>in the above code.
>
>When it is trying to resolve the path, BB is matching /a as an absolute
>path, but if your file is in /usr/boost/projects/a then this won't work.
>Essentially, you either want a relative path (the second example) or to use
>the current directory as a basis for the path (the first example).
>
>Remember: treat locating a project like locating a directory.
>
Actually, "use-project" takes an id and directory, so "./$(d)" would use
"./a" as the project id of the sub-directory "a". I always have to look
up the order. :-)

Anyway, it turns out that the problem may be with the "[ path.glob * :
Jamfile ]" part. When I run bjam in the same directory as the Jamfile
containing that code, it finds the sub-directories with Jamfile's in
them. If I run it in one of the child directories, path.glob returns
nothing. Is something broken in "path.glob"? It looks to me like it's
using the current directory instead of the directory the Jamfile is in.

Thanks,

Phillip


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