Boost logo

Boost-Build :

Subject: Re: [Boost-build] How to recursively add directories to the include path
From: Thomas Suckow (tsuckow_at_[hidden])
Date: 2011-08-02 10:30:02


> is there a way to recursively add all subdirectories of a given path to the
> list of include paths for a target?
Probably, I can think of hacks to do it, but why do you need to?
local files = [ glob-tree ... ] ;
...
<include>$(files:D)
Someone correct me if there is a better way

> I am pretty new to boost.build and
> couldn't find any documentation or examples for this problem online.
I just search all files in the boost-build folder. /usr/share/boost-build
The online docs are rarely useful to me except when I started.

> Adding source files with the glob-tree feature works fine, but now I am
> trying to do something similar for the includes, since otherwise the program
> doesn't compile.
I find it interesting you include everything in the form #include<...>
for a single executable.

> Correct me, if I am wrong, but it looks like there is no
> built-in feature that does this.
Doubtful, there are features that do "similar" things

Generally using #include<...> is reserved for libraries. So in your
code if you have a subdir that could constitute a unit of compilation
you would add a Jamfile there and specify the library to be the
contents of that folder. You could then specify a usage-requirement of
"<include>." which will add that folder to the include search path for
anyone who includes that library in another target.
To include it in Jamroot you would use path/to/subdir//target
I would also recommend using use-project in that case.


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