|
Boost-Build : |
From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-04-27 03:51:57
Rene Rivera wrote:
> Toon Knapen wrote:
>
>>Is it possible to describe template targets in the Jamrules in bjam.v1.
>>I tried but it does not seem to work.
>
>
> Not really. Since template are real targets they can only be in
> Jamfiles. Of course it's always possible to kludge something, but it
> probably not worth it.
>
No it is not worth it. Including one file defining the templates in all
other files works fine too.
>
>>So now I
>>
>>include $(PROJECT_ROOT)/template_target_desciptions ;
>>
>>in the Jamfile of some subprojects. But the documentation says that the
>>template definition is relative to the subdirectory of the Jamfile
>>containing the template definition. Is that $(PROJECT_ROOT) in my case
>>or the location of the Jamfile of my subproject ?
>
>
> Tricky question to answer, with the limited information.... The basic
> rule is that the template targets are defined in the Jamfile that
> includes the template_target_descriptions. So if you are referring to
> them in the same Jamfile you just use the base target name. If you are
> in another subproject you need to use a relative path to the template
> targets. And if you include the file from multiple Jamfiles you'll end
> up with many versions of the template same template targets. For example:
>
> root/template_target_descriptions (ex. declares a "app" template)
> root/sub1/Jamfile (includes the templates)
> root/sub2/Jamfile
> root/sub3/Jamfile (includes the templates)
>
> You'll end up with these template targets: @root/sub1/app, and
> @root/sub3/app. "<template>app" in sub1 would refer to the one in sub1
> subproject, but you could also refer to the one in the sub3 project with
> "<template>../sub3/app". And in sub2 you can only refer to the templates
> with a relative path "<template>../sub1/app" and "<template>../sub3/app".
>
> You could also you the "@_project_/.." syntax to refer to the targets
> "absolutely".
Thanks for this response. This clarifies things a lot.
toon
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