Boost logo

Boost-Build :

Subject: Re: [Boost-build] Reporting include paths for a project
From: Nogradi, Chris (Chris.Nogradi_at_[hidden])
Date: 2014-01-29 17:16:40


On Thursday, December 05, 2013 7:06 PM, Steven Watanabe wrote:
>
> It would look something like this (untested):
>
> import virtual-target ;
>
> rule print-all-includes ( project name : property-set : sources * ) {
> local result ;
> for local s in $(sources)
> {
> for local t in [ virtual-target.traverse $(s) ]
> {
> if [ $(t).action ]
> {
> local action = [ $(t).action ] ;
> local properties = [ $(action).properties ] ;
> result += [ $(properties).get <include> ] ;
> }
> }
> }
> for local include-path in [ set.unique $(result) ]
> {
> ECHO $(include-path) ;
> }
> return $(sources) ;
> }
>
> generate print-includes : path/to/your/project/ : @print-all-includes ;
>

I am trying to use this example to get all the source (C or H) for a target and then run a script against them using the original include/define for each of them. This example works much better than creating a new toolset because it can work alongside existing toolsets and features specified on the command line. But in my application the path/to/your/project/ needs to be the target specified on the command line:

generate print-includes : $(target-from-command-line) : @print-all-includes ;

Is there an easy way to do this? Assuming mytarget is an existing target that I want to apply the script against, I don't care much for this:

bjam --target=mytarget print-includes

and would much prefer this:

bjam mytarget print-includes

Any ideas on how to accomplish this without creating another toolset since I still want to be able to do this:

bjam mytarget print-includes msvc

or

bjam mytarget print-includes gcc

Thanks,

Chris

________________________________

CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and contain information that may be confidential and/or legally privileged. If you have received this email in error, please notify the sender by reply email and delete the message. Any disclosure, copying, distribution or use of this communication (including attachments) by someone other than the intended recipient is prohibited. Thank you.


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