EDE subproject confusion - emacs

I've been trying to get subprojects in EDE to work, but I don't understand much and I can't find any good documentation. What would the project configurations have to look like for the following tree:
Test
Project.el
bin
test
src
Project.el
main.cpp
class.cpp
inc
Project.el
class.h

To make a project like that, first create the toplevel project with:
M-x ede-new RET
and fill it in as an Automake or Makefile based project. (either is fine.) Then for each sub-directory, use ede-new again with the same project style. These projects will get linked together under the top-level project. You then use
M-x customize-project RET
to edit any features you need for the project. If you use dired, you can mark files and use the Project menu to add those files to some target, or create new targets to add them to. You don't need to know what is in the Project.ede files to do that. As it happens, the Project.ede file is just some Emacs Lisp code that creates the objects that represent the project you are working in.

Related

eclipse non workspace source folders

I have a project requirement so that CDT things peacefully co-exist with other tools from other CDT like vendors. To that end, I have this directory structure:
+(root)
|->libfoo/src, and libfoo/include <- the foo package
|->libbar/src, and libbar/include <- the bar package.
|->application/src -< the application lives here.
|->keil <-- all things KEIL ide go here
|->xilinx <- "vivado/vitus(eclipe) '.project/.cproject' need to go here.
|->microsemiCM3 <- microsemisoft console '.project/.cproject' need to go here.
|->microsemiRisdV <- microsemisoft console '.project/.cproject' need to go here.
|->stm32cube <- STM32 ".project/.cproject" go here.
In addition to the above, a "main.c" file exists in each of the "tool directories, ie: there is a "main.c" file for keil, another for xilinx and another for microsemi, etc. This deals with the specifics of that compiler.
My goal is to add the source folders: ../libfoo/src and ../libbar/src to each of the eclipse based projects. These contain common code to all compilers, generally they are like a library but we compile them in as source code instead.
I create a project and select PROPERIES, "C/C++ General? and select PATH and SYMBOLS. I select SOURCE Location and I want to add two new source folders (see above). The problem is - the IDE demands these projects are part of and live in/under the directory where the .project file is located.
Suggestions?

Gtkmm in Eclipse makefile project: "could not be resolved"

I am trying to migrate a custom C++ project which uses Gtkmm3.0 to Eclipse (Oxygen) on Ubuntu 16.04. The project has its own Makefile and builds fine from the terminal within Eclipse. What I have not been able to do so far is tell the indexer about Gtkmm, and I get lots of these (which is very annoying):
When I hover over the little red bugs, it says:
Type 'Cairo::RefPtr<Cairo::Context>' could not be resolved.
I have done a lot of Googling on this and found nothing so far because all answers seem to assume the project's build tools are managed by Eclipse (See this or this, for example). In my case I have a makefile project instead of an executable project and hence some options are not available to me. For example, the first links speaks about configuring the builder:
We have to add all this directories. On Eclipse select the Project->Properties menu option. Select C/C++ Build->Settings property page and GNU C++ Compiler->Directories from the Tool Settings tab. Now we have to add all directories. In my case (Makefile project) only two tabs are available there: Binary Parsers and Error Parsers.
How can I tell the Eclipse indexer I am using Gtkmm3.0?
Found the solution that works for me:
Open a terminal and enter:
pkg-config --cflags gtkmm-3.0
You will see a list of includes directories (starting with -I). These are the directories you want to add in Eclipse so that it can locate the Gtkmm symbols in the editor.
In Eclipse, go to:
Project -> Properties -> C++ General -> Paths and Symbols
In the Includes tab, select GNU C++. You need to add here add the include directories found in step 1. There is no automated way to do this, yo must enter them one by one.
One trick that can save you some time is to edit manually the Eclipse project setting XML file and add the include directories directly in the XML file. By the end, you should have something that looks like this:
That did it for me, hope this helps!

Eclipse CDT autocompletion of #include

Eclipse CDT offers autocompletion of your header files when you write new #include "something" statements.
In our project, we use -I. and require all includes to state full paths from the project base folder. Unfortunately, I cannot get the autocompletion of Eclipse to work in this way - it only seems to work when using relative paths to the current file. (once the whole file with its path is entered, there is no issue switching to it with F3, though).
My question now is, whether one can change some options to make Eclipse's autocompletion for includes work from the project base instead of only relative to the file?
In your project properties, add the root of your project to C/C++ General -> Paths and symbols under the Include tab.

How to set eclipse to run a makefile that resides seperatly from the code

I am running a small application that test a certain module in a large project.
to do so, I created a new makefile that includes few auxiliary files (like stub.h and so).
this make file is than uses the original makefile (in other location) to compile the original code (the one tested).
to make it clearer...
original code and makefile is in BigProj/General/Manager/makefile
my app and makefile are in BigProj/General/emulator/apps/makefile
How can I instruct eclipse to show the source files from original code (BigProj/General/Manager), BUT build it from my app folder (BigProj/General/emulator/apps)?
Thanks,
AmiGal
In the project configuration panel (right click on the project folder in the project explorer, choose
Properties, or press Alt-Enter if you are already visiting the project), select the C/C++ Build sub panel, then in the Builder Settings tab, change the Build location to the one of your liking.
Normally, it should point to your source location by mean of an eclipse project variable of the form ${workspace_loc:/BigProj/General/Manager}/ or something like that. It should be straightforward to replace the relevant part with your app folder name.

[cedet]: how to add a new ede target?

I can't find an easy way to add ede targets to my projects. I am looking for the way to add an install target or even a test target to run unittest.
How do you do that with ede-project-manager ?
If you are using one of the EDE projects that supports it, the operation can be found in the menu.
Step 1: Open a file in a project directory.
Step 2: Choose the menu item "Project->Project Options->Add target"
It will ask if you want to add the current file into that target.
You can also do:
M-x ede-new-target RET
Some EDE project types don't support this concept. Most notably the built-in Emacs and Linux project types, or the ede-cpp-root project, which is a quick hack to support the basics of the Semantic parsing infrastructure.