Boost logo

Boost-Build :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2006-09-13 02:33:23


K. Noel Belcourt wrote:
> 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?

To answer this specific question; use the built-in SHELL rule to catenate
each of the Jamfiles and use MATCH on the result to find the exe targets.

But I guess there might be a better overall solution.

// Johan


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