Boost logo

Boost-Build :

Subject: Re: [Boost-build] Global headers across projects
From: Alexander Sack (pisymbol_at_[hidden])
Date: 2008-10-15 11:33:46


On Wed, Oct 15, 2008 at 11:19 AM, Phillip Seaver <phil_at_[hidden]> wrote:
> Alexander Sack wrote:
>> On Tue, Oct 14, 2008 at 3:38 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
>>
>>> AMDG
>>>
>>> Alexander Sack wrote:
>>>
>>>> alias common_headers : : : <include>h1_dir <include>h2_dir>;
>>>>
>>>> However I can't use this in my Jamroot's project definition as a
>>>> requirement a la:
>>>>
>>>> project myproj
>>>> : requirements common_headers
>>>> ;
>>>>
>>>>
>>> project myproj : requirements <source>common_headers ;
>>>
>>>
>>>> constant some_headers : <include>blah blah etc.
>>>>
>>
>> Still does not work - I tried this btw:
>>
>> error: Unable to find file or target named
>> error: 'common_headers'
>> error: referred from project at
>> error: <somepath>
>>
>> So my project hierarchy looks like this:
>>
>> myproj/Jamroot
>> myproj/liba/Jamfile
>> myproj/liba/subcomponentA/Jamfile
>>
>> I'm calling bjam against myproj/liba/Jamfile which calls build-project
>> subcomponentA ; etc.
>>
>> I'm assuming that all sub projects in my hierarchy inherit
>> requirements from Jamroot right?
>
>
> That's the way it's working for me. I have "project apago :
> requirements <variant>debug:<define>_DEBUG ...". You might try putting
> the includes directly on the project instead of using an alias. Like this:
>
> project myproj : requirements <include>h1_dir <include>h2_dir ;
>
> Also, I just noticed that in an earlier email, you have
> "<include>h2_dir>;" If that's what you actually have in your Jamroot,
> that would cause a problem, since it would add "h2_dir>;" as an include
> path and would not terminate the alias target, since there has to be a
> space before the semi-colon (";"). If that's what you have, you should
> try changing that first.

Philip, thanks! No that was a typo on the list, my include statements
are correct.

I *BELIEVE* the issue is not the alias itself, it is the sub project
can't find the target alias from my Jamroot. Do you have subprojects
in your build hierarchy?

So do you have:

myproj/Jamroot
myproj/liba/Jamfile
myproj/liba/somecomponent/Jamfile

The error messsage (see below) when I do

'bjam myproj/liba' which calls build-project somecomponent. It seems
bjam can't deference the target alias from Jamroot. NOW I am under
the belief that bjam looks at my directory structure trying to find
the Jamroot as the root of my project hierarchy and load everything
from there (it has to because if I use path-constants instead of
alias, it works minus the header sorting which is killing me right
now).

in myproj/Jamroot I have

alias common_includes : : : <include>somerelativepathfrombuildroot ;

project myproj
   : requirements <source>common_includes ...(I have more requirements here)
   ;

in myproj/liba/somecomponent/Jamfile

I have

project somecomponent ;

lib somelib : <include>. <link>static ;

etc.

I would assume that somecomponent would also inherit the
common_include alias but instead barfs with:

error: Unable to find file or target named
error: 'common_includes'
error: referred from project at
error: 'myproj/liba/somecomponent'

What am I doing wrong? I'm gong to try a simpler build and see if I
can reproduce and send to list.

-aps


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