Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Building nested projects
Building nested projects [message #121073] Wed, 15 September 2004 11:12 Go to next message
Eclipse UserFriend
Originally posted by: nigel.cook.gmail.com

I have a C++ project that I'm trying to build using the CDT plug-in.

The main project resides in ~/Main (just as an example). In that
directory, I have a makefile, a make.defs file that is included, and all
the subdirectors for includes, source, etc.

There is also a subdirectory that contains my CPPUnit test harness source.
Let's say ~/Main/Test. That directory contains the makefile for the test
executable, and also includes the make.defs file from above (include
../make.defs).

I don't ever build the Main executable, just the Test executable, in
~/Main/Test. I've tried creating a standard project from the makefile in
that directory, and that worked okay. However, for whatever reason it
couldn't 'discover' the source code from the Main project. The indexer
brings up a few thousand warnings.

Then I tried creating a new project from the ~/Main directory, but am
having difficulties building the makefile in the Test directory...I get a;

'No rule to make target 'Test/makefile.linux'. Stop.'



To me it doesn't matter which directory I start from, as long as I can
build the Test executable, and index the Main source headers.

Can I get either one of these approaches to work with the CDT?
Re: Building nested projects [message #121139 is a reply to message #121073] Thu, 16 September 2004 10:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nigel.cook.gmail.com

I'll answer my own question, for future generations. It's obvious now, but
hopefully some other newbie may be enlightened ;-)

In the Project settings, in Make Project tab;

Build Command: "make -C ~/somewhere/main_proj_dir/subdir -f my_makefile"

The '-C' flag changes the 'working directory' to the subdirectory, the
'-f' flag specifies the specific makefile in that directory.

What DOESN'T work (in my case), was

"make -f subdir/my_makefile"

...since the references in the makefile are relative to that directory. If
the -C flag isn't used, all relative references are still from the main
project directory.

Hope this helps somebody.

Now to see if indexing will work for me ;-)
Re: Building nested projects [message #121173 is a reply to message #121139] Thu, 16 September 2004 22:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lothar.xcerla.com

Hi,

I wrote a plugin that allows to execute dedicated builds for subdirectories.

This plugin allows to build C/C++ projects with the SCons build tool. In
order to use it you must install SCons first. I tested it with release
0.95, but it should work also with newer versions.

The plugin can be updated easily through Eclipse built-in Install/Update
Mechanism. Just add http://nic-nac-project.de/~lothar/eclipse/update/ to
your list of Update Sites. Please see the Eclipse help for information on
installing feature plugins through Eclipse's Update Mechanism.

For more information see
http://nic-nac-project.de/~lothar/eclipse/update/SConsBuilde rPlugin.html

Please let me know your opinions about the plugin.

Lothar
Re: Building nested projects [message #121277 is a reply to message #121173] Mon, 20 September 2004 09:58 Go to previous message
Eclipse UserFriend
Originally posted by: nigel.cook.gmail.com

> This plugin allows to build C/C++ projects with the SCons build tool. In
> order to use it you must install SCons first. I tested it with release
> 0.95, but it should work also with newer versions.

> Please let me know your opinions about the plugin.

Hi Lothar,

Looks really interesting, but the SCons requirement is a bit of an issue
for me. From what I gather looking at the FAQs that's a necessity. We have
10+ people using the same makefiles, so it's out of my hands.

Thanks,
Nigel
Previous Topic:command not found
Next Topic:Step-by-step - developing FLTK applications in Eclipse
Goto Forum:
  


Current Time: Sun Jun 08 12:15:48 EDT 2025

Powered by FUDForum. Page generated in 0.04354 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top