Boost logo

Boost-Build :

Subject: [Boost-build] How to recursively add directories to the include path
From: Thomas Bretgeld (thomas.bretgeld_at_[hidden])
Date: 2011-08-02 07:22:12


is there a way to recursively add all subdirectories of a given path to the list of inlude paths for a target? I am pretty new to and
couldn't find any documentation or examples for this problem online.
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. Correct me, if I am wrong, but it looks like there is no built-in feature that does this. I think that what I need is a rule that
takes the path to search and an exclude pattern (e.g. to exclude ".svn" directories) and then generates a list of all matching subdirectories and adds
each entry to the list of includes. However, I have no idea on how to do this. Any help?

Kind regards,
Thomas Bretgeld

#Other libraries
lib librt : : <name>rt ;

#Global project settings that apply to all sub-projects
project bla
: requirements
: default-build
# debug
: build-dir

#Generator rule that adds the <variant> setting to the filename
#e.g. "_release" or "_debug"
import virtual-target ;
rule build-tag-rule ( name : type ? : property-set )
   if $(type) = EXE
     suffix = [ $(property-set).get <variant> ] ;
     return [ virtual-target.add-prefix-and-suffix $(name)_$(suffix) : $(type) : $(property-set) ] ;

exe Test :
  [ glob-tree *.h *.cpp *.c : .svn ]
#Requirements and conditional requirements
#Problem is here
#Default build properties
#Usage Requirements

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