Problems with using Eclipse as IDE for cbmroot

Added by Volker Friese about 7 years ago

For the development in CbmRoot, I use the Eclipse IDE (Kepler Service Release 2) on MAC OS 10.9.5. To set up the proper project files when building the project, I call cmake with the proper arguments:

cmake -G"Eclipse CDT4 - Unix Makefiles"

In order for Eclipse to work properly, I have to manually do the following actions:

  • In "Project->Properties->C/C++ Include Paths and Symbols", I have to add "/usr/bin/c++/4.2.1" as external include path.
  • In "Project->Properties->C/C++ Make Project", Tab "Environment", I have to set the environment variables PATH, SIMPATH and FAIRROOTPATH to their proper values.

So far, so good - once to be done when building the project, and from thenceforth, development and compilation can be done within Eclipse.

However, this manually added project information is occasionally lost, such that I have to enter it again in the way decsribed above. This seems to happen each time a call to cmake is triggered by calling make - which happens, I understand, if one of the CMakeFile.txt is changed. Presumably, cmake creates the Eclipse project file again but without the added information. This is very inconvenient.

Does somebody else use Eclipse as IDE? If yes, do you encounter the same problem? Or did you find a solution?

Replies (2)

RE: Problems with using Eclipse as IDE for cbmroot - Added by Christian Pauly over 6 years ago

Hi Volker

Just found this old thread from you regarding Eclipse and cbmroot.

I started to have a look at Eclipse as well, but never used it before for anything.
Do you still use it ? Would you recommend using it ?

Besides things mentioned in your thread above, is there any more hints what one has to do to integrate cbmroot into eclipse ?

RE: Problems with using Eclipse as IDE for cbmroot - Added by Volker Friese about 6 years ago

Dear Christian,

sorry, I did not notice your posting earlier. There seems to be no email notification upon posts (although I "watch" the issue).

I personally find Eclipse quite convenient. Nice source browser, plus it has a code interpreter which points you to programming errors in the edit window (just like Word does on typing errors), so you can remove most errors without even compiling. That's why I would like to keep it.

No, I did not need any other things in order to use Eclipse. The project has to be built with the cmake argument G"Eclipse CDT4 - Unix Makefiles". In Eclipse, choose "File -> Import" from the menu. Then choose for the import source "General -> Existing projects into workspace". -Next . Then, under "select root directory", use the "browse" button to select the build folder of your cbmroot. That's all.

The problem outlined above remains. However, it is relatively easy to circumvent. Actually, the variables PATH, SIMPATH and FAIRROOTPATH are not needed for the "normal" compilation; they are only required for cmake. So, whenever a CMakeList.txt changes and I crash with compiling with Eclipse, I just call "make" once manually from the shell. After that, Eclipse works fine again.

Not perfect, but what can one expect from software?