From: Vladimir Prus (ghost_at_[hidden])
Date: 2008-02-13 01:28:39
On Tuesday 12 February 2008 02:30:53 Khassapov, Alex wrote:
> Hi, I wonder how to use rules from module project-rules (i.e.
> use-project) outside Jamfile?
> I want to move some functions form Jamfiles to a separate utils.jam
> file, but these rules are not available there. Do I need to pass the
> current project from Jamfile to the rules in utils.jam somehow?
The way 'use-project' is implemented, it's rather integrated with
project loading. You can try project.use, see how load-used-projects
in project.jam uses that.
Generally, maybe rules in project-rules module need a current project,
and to call them, you need to know the current project somehow.
One way to know the current project is the project.current rule.
Note that it returns valid value only when a Jamfile is being read. After
Jamfile is read, the return value is not meaningful.
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