How to set Eclipse for cmake project?

10,433

Solution 1

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.

Solution 2

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.

Share:
10,433
Anil
Author by

Anil

I miss my life when there is nothing to do, I look forward for an interesting and fun life with learning.

Updated on June 04, 2022

Comments

  • Anil
    Anil almost 2 years

    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.