Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cmake support in Eclipse

Tags:

c++

eclipse

cmake

According to this, I have 3 options to use cmake in Eclipse CDT for C++. None of them works.

The first is because I use out-of-source builds and the limitations of the generator is so lame. Also, it uses a hardcoded Eclipse project template, so it is fragile like hell. The second is the poor man's version of cmake support. It does not add any value to Eclipse, really. The third one simply does not work. I can't make an existing cmake project. I can create a new one, but not opening an existing one. Also, the cmake properties in the project properties windows throw an exception and that's it. Does not even show up.

Is there any GOOD support in Eclipse for cmake? Or any other powerful IDE? Like adding the CmakeList.txt and the corresponding project is created? I am mainly interested in having the proper include paths and the global make targets based on the cmake files. And of course it would be nice to have syntax colored editing of cmake files, etc.

like image 777
McHalls Avatar asked Aug 02 '11 17:08

McHalls


People also ask

Does eclipse support CMake?

We successfully use both Eclipse CDT and Qt Creator with a large CMake based project. For Eclipse, we usually use option two exactly as described. There is also a CMake Eclipse plug-in called CMake Editor for syntax highlighting and command completion.

How do I run CMake project in eclipse?

In Eclipse, select File > New > C Project. Enter a project name and choose the root of your source tree as the project location. Click Finish, and you have a CMake project in your workspace.

Does CMake work for C++?

CMake is a collection of open-source and cross-platform tools used to build and distribute software. In recent years it has become a de-facto standard for C and C++ applications, so the time has come for a lightweight introductory article on the subject.

How do I run a CMake program?

Running CMake from the command line From the command line, cmake can be run as an interactive question and answer session or as a non-interactive program. To run in interactive mode, just pass the option “-i” to cmake. This will cause cmake to ask you to enter a value for each value in the cache file for the project.


2 Answers

We successfully use both Eclipse CDT and Qt Creator with a large CMake based project.

For Eclipse, we usually use option two exactly as described. There is also a CMake Eclipse plug-in called CMake Editor for syntax highlighting and command completion.

Personally, I am using QtCreator. It has quite good CMake support and is very fast. You should initially configure your project with the CMake GUI (using the Make or NMake Generator) and then open your top-level CMakeLists.txt file in QtCreator and point it to your already configured binary directory.

like image 177
Sascha Avatar answered Oct 03 '22 23:10

Sascha


Have you taken a look at Qt Creator? It might have the features you are looking for.

like image 42
decimus phostle Avatar answered Oct 04 '22 00:10

decimus phostle