Search code examples
c++cmakeeclipse-cdt

Eclipse CDT include with multiple versions of Gazebo


I'm working on a C++ project in eclipse (Mars on Ubuntu 14.04) that needs to include files from gazebo. Currently those files exist at /usr/include/gazebo-6.5. However, if I update gazebo to a newer version it it's folder name changes and my code won't compile.

Most build systems allow for something like this. Namely, in CMake I could use find_package(Gazebo) because gazebo provides a gazebo-config.cmake which contains all the information about it's includes and libraries.

Things I've thought of:

  • Use CMake in eclipse instead of the horrible .cproject file?
  • grab the value from the config.cmake file?
  • set a build variable that is easier to change than the C++ include path?
  • somehow Include anything that matches /use/include/gazebo-##.##

So, What is a robust version-independent way I can include these files?


Solution

  • There is at least one CMake plug-in in the Eclipse Marketplace that may suit your needs.

    At the moment (Jan 2016) there is active development on supporting CMake in the core of CDT for the CDT 9.0 release in June 2016.

    Contribute to the discussion on the cdt-dev mailing list: https://dev.eclipse.org/mhonarc/lists/cdt-dev/msg29897.html