You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by ihatethetv <gl...@gmail.com> on 2008/11/19 18:01:56 UTC
Help with C++ includepaths - Can I use wildcards? make a external
repository list?
In a project I work on, we use ant to build C++. We have about 40 different
"components" which exist in different directories each with it's own ant
file. All of these components inherit from a shared class which we use to
connect them, and so all of them need to include a .h file from that
directory. When we add a new #include to that .h file, we then need to go
add a new <includepath ...> line to the build.ant file for EVERY one of the
~40 components that inherit from that file.
I'm in a position right now where I have to change all those files so I'm
trying to find a permanent solution.
I'm wondering if I can change the list of includepaths....e.g.
<includepath location="../blah/include"/>
<includepath location="../blah2/include"/>
...
<includepath location="../blah40/include"/>
to a single line:
<includepath location="../*/include"/>
I tried both "*" and "**", but no luck.
Also, I considered creating a single "includes.xml" file and then somehow
including it (I looked into xinclude, but the "cc" doesn't seem to support
nested includes)
I'm open to other suggestions too.
Thank You,
Glen
--
View this message in context: http://www.nabble.com/Help-with-C%2B%2B-includepaths---Can-I-use-wildcards--make-a-external-repository-list--tp20584286p20584286.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Help with C++ includepaths - Can I use wildcards? make a
external repository list?
Posted by ihatethetv <gl...@gmail.com>.
Dominique Devienne-2 wrote:
>
> Sorry, I assumed you knew about Ant's import. It can only be used at
> the top level of a build file.
>
> CppTasks supports defining named compiler/linker configurations (with
> nested includepath and all), which you'd put into a common build file,
> that you'd import from all your 40 component build files, in which
> you'd reuse the named configs inside <cc>. That's what I was referring
> to.
>
Thanks Dominique, it sounds like that's what I want.
Yea, I should have prefaced all this with: I am not very familiar with ant,
although I have a fairly complex working example in front of me.
Could someone please provide me a syntactical example of "defining named
configurations" and how to reference them in the <cc> tag. Sorry, but I'm
in need of a bit of hand-holding. Thanks =)
Thank you,
Glen
--
View this message in context: http://www.nabble.com/Help-with-C%2B%2B-includepaths---Can-I-use-wildcards--make-a-external-repository-list--tp20584286p20588748.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Help with C++ includepaths - Can I use wildcards? make a external repository list?
Posted by Dominique Devienne <dd...@gmail.com>.
> It seems as though import wont help as I get the following error when trying
> to replace all the lines with a file and an <import> statement.
>
> build.ant:23: cc doesn't support the nested "import" element.
Sorry, I assumed you knew about Ant's import. It can only be used at
the top level of a build file.
CppTasks supports defining named compiler/linker configurations (with
nested includepath and all), which you'd put into a common build file,
that you'd import from all your 40 component build files, in which
you'd reuse the named configs inside <cc>. That's what I was referring
to.
That's what I did to build projects with many different shared
libraries I needed in mixed Java/C++ development. But that was several
years ago, and a different job. An ex colleague on this list might be
able to share some of this stuff, although by now it may have been
replaced. --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Help with C++ includepaths - Can I use wildcards? make a
external repository list?
Posted by ihatethetv <gl...@gmail.com>.
Dominique Devienne-2 wrote:
>
> On Wed, Nov 19, 2008 at 11:01 AM, ihatethetv <gl...@gmail.com>
> wrote:
>> In a project I work on, we use ant to build C++. We have about 40
>> different
>> "components" which exist in different directories each with it's own ant
>> file. All of these components inherit from a shared class which we use
>> to
>> connect them, and so all of them need to include a .h file from that
>> directory. When we add a new #include to that .h file, we then need to
>> go
>> add a new <includepath ...> line to the build.ant file for EVERY one of
>> the
>> ~40 components that inherit from that file.
>
> use <import> and pre-defined named compiler/linker definitions, that's
> the best solution. I don't have my old <cc> builds to give you an
> example, sorry.
>
>> to a single line:
>>
>> <includepath location="../*/include"/>
>
> location is for a single file. I don't recall what includepath is
> exaclty, but Ant's <path> supports <pathelement path="dir1;dir2;.." />
> as a nested element, so try that. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>
It seems as though import wont help as I get the following error when trying
to replace all the lines with a file and an <import> statement.
build.ant:23: cc doesn't support the nested "import" element.
-Glen
--
View this message in context: http://www.nabble.com/Help-with-C%2B%2B-includepaths---Can-I-use-wildcards--make-a-external-repository-list--tp20584286p20587690.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Help with C++ includepaths - Can I use wildcards? make a external repository list?
Posted by Dominique Devienne <dd...@gmail.com>.
On Wed, Nov 19, 2008 at 11:01 AM, ihatethetv <gl...@gmail.com> wrote:
> In a project I work on, we use ant to build C++. We have about 40 different
> "components" which exist in different directories each with it's own ant
> file. All of these components inherit from a shared class which we use to
> connect them, and so all of them need to include a .h file from that
> directory. When we add a new #include to that .h file, we then need to go
> add a new <includepath ...> line to the build.ant file for EVERY one of the
> ~40 components that inherit from that file.
use <import> and pre-defined named compiler/linker definitions, that's
the best solution. I don't have my old <cc> builds to give you an
example, sorry.
> to a single line:
>
> <includepath location="../*/include"/>
location is for a single file. I don't recall what includepath is
exaclty, but Ant's <path> supports <pathelement path="dir1;dir2;.." />
as a nested element, so try that. --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org