Boost logo

Boost-Build :

From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2006-09-13 09:03:05


On Sep 13, 2006, at 12:33 AM, Johan Nilsson wrote:

> 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.

Looks good to me, thanks.

> But I guess there might be a better overall solution.

Dave suggested using the internal bjam data structures but, in lieu
of an example, that approach is beyond me.

-- Noel Belcourt


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