On Fri, Apr 3, 2015 at 2:03 PM, Sherwood Hu <sherwood@morovia.com> wrote:

Hi all,

 

I have a project with a dozen sub-projects, with a jamroot under the root and jamfile under each sub-project.

 

Most sub-projects have a “stage” target which copied the files to a location. But not all have this target. In order to run “stage” at the top, I have to define:

 

alias stage  : sub1//stage sub2//stage … ;

 

Is it possible to look into the jamfile of a subproject and put it into this alias programmatically?


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

Obviously put in a loop and/or local rule to avoid copy/paste ;-)

HTH.

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