Robotics StackExchange | Archived questions

How to have a single reference to catkin packages in generate Eclipse project?

How to reproduce my issue

To setup an Eclipse workspace, I followed the instructions in the IDEs page, which means I run the following command:

catkin_make --force-cmake -G"Eclipse CDT4 - Unix Makefiles" 

What happens

Eclipse creates FOUR versions of your catkin source space (the src directory under your workspace root):

  1. Each package directly under Project@build
  2. Each package in [Source Directory]
  3. Each package under [Subprojects]
  4. Each package under [Subprojects]/Project

I notice that some of these contain gtests (presumably included by cmake's add_subdirectory()) while some do not.

Why this is a problem for me

Eclipse has a lot of handy ways to jump around your code quickly:

However, when I would expect Eclipse to return to an editor already open for a file (e.g. main.cpp from [Subprojects]), it opens another editor for another version of the file (e.g. main.cpp from [Source Directory]). I think different tools default to different versions?

This leads to multiple editors open for the same file, which Eclipse treats as different files. So when I make changes while jumping around like I'm accustomed to, unsaved changes end up in two editors open for the same file, and when I try to save, I get a conflict. I end up having merge them. Not fun, to correct or to avoid.

I think it also may interfere with the indexer. Which breaks parts of my workflow such as using the call hierarchy (CTRL-ALT-H) to make sure I've gotten everything when I'm refactoring.

What I would like answered

How do I only have a single version of my packages recognized by my workspace? Without having to change settings every time I rebuild it?

Is this a bug or a poorly-documented feature? If it's a bug, I'm copy-pasting this post to GitHub. If it's a poorly-documented feature, I'd like to request an entry on the IDE page.

Thanks in advance.

Asked by b-adkins on 2013-11-23 16:32:16 UTC

Comments

+1 against annoyance =)

Asked by felix k on 2013-11-24 22:46:46 UTC

Unfortunately I don't use Eclipse, so I don't know, but generally this tends to be a CMake specific thing and not generally anything to do with catkin. You might have better luck trying to reproduce this with CMake only and posting to a CMake help site, like StackOverflow.

Asked by William on 2013-11-25 07:30:51 UTC

Did you find any solution for this? I/We are also struggling with this annoying fact!

Asked by einrob on 2014-08-19 08:32:27 UTC

Answers