I have just managed after days of effort to get a program to build with CMake/Ninja invoked from Eclipse, and to run in the Eclipse debugger with all the fancy features working: breakpoints, hovering over variables to see their values, etc. Eclipse and CDT are new to me; I've dabbled with CMake and Ninja before. Prior to this I've used the Unix command line as my IDE.
I still don't know for sure whether I'm using cmake4eclipse or the CDT CMake support.
I would like to work with someone to write a better introduction to cmake4eclipse. Here's a start. I'm sure it's got some errors and it's still a bit terse.
-------
Eclipse is an IDE framework. CDT is a group of plug-ins that tailor and extend Eclipse for C and C++ development. Typically you would install a packaging that includes both together. CDT normally generates Makefiles and invokes Make to compile and link programs. CMake is an alternative to Make; it knows how to build using different toolchains, e.g. for cross-compiling, and it knows how to build for release vs. debug, among other things. CMake reads a description of how your software builds from a CMakeLists.txt file and generates detailed commands to build a specific instance, e.g. linux x86_64 debug build. CMake can generate commands in a variety of forms such as Makefiles, Ninja, Windows NMAKE, Visual Studio projects, and Eclipse projects. cmake4eclipse is an Eclipse plug-in that tailors CDT to work with CMake instead of its usual use of Makefiles.
With cmake4eclipse, you are responsible to maintain your CMakeLists.txt file. When you set up an Eclipse project with cmake4eclipse, the Eclipse project is generated from the CMakeLists.txt. If you add a new file to the Eclipse project, it's up to you to add it to the CMakeLists.txt file. This approach is beneficial if, for example, you have multiple developers using different IDEs. You don't store any IDE's project in the repository but instead only store the CMakeLists.txt files. You, the developer who justly chooses Eclipse/CDT over other, second-rate IDEs, reap the benefits of Eclipse's integrations with debuggers, repositories, etc. without forcing your choice onto other team members.
Eclipse using cmake4eclipse detects when it needs to re-generate the Eclipse project from the CMakeLists.txt file, and when it needs to re-generate the Ninja (or Make, or whatever) files from CMakeLists.txt.
cmake4eclipse differs from the CDT CMake integration introduced in CDT 9.3 in that ... (I have no idea).
-------
Would someone who knows what's going on like to work with me on this?
Thanks,
Steve