Boost logo

Boost-Build :

Subject: Re: [Boost-build] [SPAM] Re: Is it possible to find out if a named target exists in a subproject jamfile
From: Sherwood Hu (sherwood_at_[hidden])
Date: 2015-04-05 11:38:07


Tried it. Did not work.

From: Boost-build [mailto:boost-build-bounces_at_[hidden]] On Behalf Of Rene Rivera
Sent: Friday, April 3, 2015 3:54 PM
To: steven_at_[hidden]; Boost.Build developer's and user's list
Subject: [SPAM] Re: [Boost-build] Is it possible to find out if a named target exists in a subproject jamfile



On Fri, Apr 3, 2015 at 2:50 PM, Rene Rivera <grafikrobot_at_[hidden]<mailto:grafikrobot_at_[hidden]>> wrote:
On Fri, Apr 3, 2015 at 2:43 PM, Steven Watanabe <watanabesj_at_[hidden]<mailto:watanabesj_at_[hidden]>> wrote:
AMDG

On 04/03/2015 01:25 PM, Rene Rivera wrote:
>
> You will likely have to get the latest BBv2 from develop branch for this to
> work.. You can do something like this:
>
> ===
> import project ;
> local sub1-module = [ project.find sub1 : $(__file__:D) ] ;
> local sub1-target = [ project.target $(sub1-module) ] ;
> if [ $(sub1-target).has-alternative-for-target stage ]
> {
> # "stage" is declared in project.. do something..
> }
> ===
>

This won't work because the parent project is
loaded /before/ any subprojects.

IIRC calling project.find directly circumvents that. As it loads the given project regardless.

PS. I should have obviously said this was totally untested :-)


--
-- Rene Rivera
-- Grafik - Don't Assume Anything
-- Robot Dreams - http://robot-dreams.net>
-- rrivera/acm.org<
http://acm.org/> (msn) - grafikrobot/aim,yahoo,skype,efnet,gmail



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