[cmake-developers] Extracting target metadata, IDE integration

Alexander Neundorf neundorf at kde.org
Thu Sep 25 16:29:44 EDT 2014


On Thursday, September 25, 2014 07:14:38 Anton Makeev wrote:
...
> Here is why I think the discussed functionality should not be a separate
> generator:
> 
> CLion doesn’t have it’s own project model nor is intended as build tool
> replacement. Currently, the only option for CLion users is makefiles build,
> that is not a best option for everyone: there is a good and fast
> alternative ‘Ninja’. Ideally, users should be able to choose whatever tool
> better suites them.
> 
> The problem is that the generated Makefiles are used both, for internal
> needs, like reading project structure, and also to build and run the user’s
> program. If we wanted to support Ninja generator, we would need to rewrite
> all the logic that retrieves the project information, using the files that
> are created by Ninja generator. While I suppose it’s possible, it’s not the
> best option - very error prone and resource demanding.
> 
> If CMake generated a separate descriptor, regardless the generator used
> (Makefiles, Ninja), it would be much easier to support; and the users will
> benefit from better, more reliable and faster CMake integration in an IDE.

not sure I fully understand, but it seems you are maybe not aware how the 
"extra generators" in cmake work.

Those are basically run additionally to a "normal" generator. I.e. cmake 
generates makefiles or ninja files, and additionally project files for an IDE. 
This project file typically contains the list of targets, and for each target 
the build command. At that point it doesn't matter much anymore for the IDE 
whether the main generator is make or ninja.
This is implemented with the Eclipse generator, the CodeBlocks generator and 
the Kate generator. They all write a project file for the IDE additionally to 
the makefiles/ninja files for the actual building.

Alex




More information about the cmake-developers mailing list