2

I have c++ project with cmake, for building it,i wanted to integrate the project in eclipse ide in linux?And i also googled for the same,but didn't get appropriate answers,Please help me with the same.Thank you in advance.Other IDE are also ok,with steps to import the project without ant errors.Thanks for the help in advance.

4
  • KDevelop is able to read CMake files very well under Linux. But for me, makefiles is the best coming from CMake.
    – Caduchon
    Commented May 20, 2016 at 14:35
  • Thank you Caduchon,but currently working with eclipse
    – Anil
    Commented May 20, 2016 at 14:36
  • You said "other ide are also ok". It's ambiguous.
    – Caduchon
    Commented May 20, 2016 at 14:37
  • ya,sorry for that Caduchon,and if you got steps for kdevelop,can you please share ,thanx
    – Anil
    Commented May 21, 2016 at 4:22

2 Answers 2

4

The cmake4eclipse Eclipse plugin from the Eclipse marketplace is able to create makefiles (or other buildscripts; it is your choice) from your CMakeLists.txt and build your Eclipse project. Once configured, there is no need to manually run cmake -G "Unix Makefiles". Project settings are stored in the .cproject file and taken from your CMakeLists.txt.

It integrates to CDT, so using the plugin, You should be familar with CDT`s project preference pages (which may be confusing).

To have syntax highlighting in CMakeLists.txt, try cmake-editor.

DISCLAIMER: I am the author of cmake4eclipse.

0

Using CMake you can generate a project for Eclipse and then open it in the IDE. CMake will be called automatically to regenerate project if you make some changes at that level.

5
  • I just generated .project and .cproject files using cmake,can you please tell me about the next steps.really needed
    – Anil
    Commented May 21, 2016 at 4:39
  • As far as I remember you can now just open these project in the the Eclipse.
    – Dmytro
    Commented May 22, 2016 at 14:11
  • Ya,I can open but how to run if I need to run different modules of the project?help me plz
    – Anil
    Commented May 22, 2016 at 14:29
  • Look into Run menu. From there you can manually create run and debug configurations for each module you have to run. CMake won't do it for you.
    – Dmytro
    Commented May 22, 2016 at 19:18
  • Yes, sure. Moreover, I would recommend you to generate makefiles instead of eclipse project, create project at source location and then use make to build all the things. For me it more universal because you can also build from pure shell if needed.
    – Dmytro
    Commented May 24, 2016 at 19:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.