|
Boost-Build : |
Subject: Re: [Boost-build] can I determine if a project has been added?
From: Vladimir Prus (ghost_at_[hidden])
Date: 2010-12-09 15:42:12
On Thursday, December 09, 2010 22:48:38 Spencer E. Olson wrote:
> Is there some way that one project can test whether another project has
> been added, such that referencing a target in that other project will be
> resolved?
>
> I'd like to optionally specifiy some metatargets (exe, alias, ...)
> depending on whether a particular project has been added with
> 'use-project'
>
> Configuration is something like this:
> <root-project/Jamroot>
> use-project /lib1 : ./lib1/ ;
> use-project /lib2 : ./lib2/ ;
>
> <lib1/Jamroot>
> lib mylib : ... ;
> ...
>
> <lib2/Jamroot>
> lib mylib : ... ;
>
> if lib1 {
> lib mylib2 : ... ;
> exe exe2 : /lib1//mylib ;
> }
Try this:
path-constant HERE : . ;
import project ;
if [ project.find /lib1 : $(HERE) ] {
}
This is untested code.
- Volodya
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build: http://boost.org/boost-build2
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