Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2006-09-13 07:06:49

"K. Noel Belcourt" <kbelco_at_[hidden]> writes:

> Hi,
> In my Jamroot, I need a list of all the exe targets defined anywhere
> in the nested Jamfiles. I want to do this so I can have a top-level
> list of all executable targets to install without asking the user to
> enumerate each target explicitly. Our directory structure is
> arbitrarily named by the user, but the Jamfiles are never more than
> two levels deep. It's easy to get a list of all the nested Jamfiles
> local cwd = [ PWD ] ;
> all-jamfiles = [ glob */Jamfile */*/Jamfile ] ;
> But I can't see how to grep each Jamfile to get a list of the
> executable targets without writing a custom scanner. I tried this
> all-executables = [ MATCH "^exe (.*)" : $(all-jamfiles) ] ;
> which only greps the Jam file name, not the Jamfile contents. Any
> ideas how to accomplish this?

You don't want to do it that way. The top-level jamfile needs to
import all of the subordinate Jamfiles anyway (at least indirectly,
via build-project). That builds up some bjam datastructures that
describe all the targets to be built. You should be able to traverse
those structures and find all the executables. Now, exactly how to do
that, I don't know. Hopefully, Volodya can chime in.

Dave Abrahams
Boost Consulting

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