Boost logo

Boost-Build :

From: David Abrahams (dave_at_[hidden])
Date: 2005-06-16 05:53:31


Vladimir Prus <ghost_at_[hidden]> writes:

> On Sunday 12 June 2005 14:54, David Abrahams wrote:
>
>> Okay, here's another. This rule is a common rule meant to be called
>> from a Jamfile. Note the extensive use of backtrace and peeking into
>> other modules in order to do simple things like access path variables
>> and declare targets!
>>
>>
>> rule build-local-docs ( )
>> {
>> import boostbook ;
>> import docutils ;
>> import path ;
>> import modules ;
>>
>> # Where is the calling Jamfile located?
>> local bt = [ BACKTRACE 2 ] ;
>> local caller-dir = [ path.make $(bt[5]:D) ] ;
>>
>> # Find the sources and locate relative to caller-dir so that I can call
>> # target rules on them.
>> local misplaced-sources = [ path.glob $(caller-dir) : *.rst ] ;
>
> Hmm... did you try something like:
>
> local c = [ project.current ]
> local project-module = [ $(c).project-module ]
> module $(project-module)
> {
> # Declare everything you want.
> }
>
> That would be equivalent to putting the code in "{}" right in invoking
> Jamfile.

Of course I didn't :)
How would I know to do something like that?

Do you think that's an appropriate strategy for the world-at-large,
and not just the cogniscenti?

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

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