Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Antwort: CMake support in Eclipse CDT

Hi Alex,

I adopted
and expanded it silently to full cmake support, not just scanner discovery. The current state of the implementation is hosted here:

I agree with what you said about the "one thing causing lot of issues". My approach is like this:
- .project and .cproject stay at the projects root and can be checked in (new project type: CMake project)
-->  as a result, Eclipse's integration of version control systems works like expected
- CMake's out of source build is used, one build output subdir per build configuration
--> Eclipse will find the build output and can automatically create a launch configuration, for example,
     or use its binary parsers, etc... The output stays related to the project.
- per build configuration, different cmake invocations are supported (CMAKE_BUILD_TYPE, CMAKE_TOOLCHAIN_FILE, -D, -G ...)
--- its is simply possible to send a project through a cross compiler by chaning the build configuration
--- I am not sure yet if it is neccessary to have one configuration build with make and the other one with ninja, but what do I know?
- the cmake plugin will parse the compile_commands.json file
--- from that information, it can guess the compiler and set the corresponding error parser
--- scanner discovery: include paths, defines
--- detect source files outside of the eclipse project that get compiled  (cmake set( SRC ../file.cpp) ) and place them into a virtual folder inside the eclipse project

so actually, new CDT project nature and then read all the neccessary information out of the compile_commands.json file.

By now, I use CDT 8.7/8.8 as base, but with the planned 9.0 Neon release it should be easier to get all these dynamic settings in shape.


Von:        Alexander Neundorf <neundorf@xxxxxxx>
An:        cdt-dev@xxxxxxxxxxx
Datum:        2015-10-01 21:50
Betreff:        Re: [cdt-dev] Antwort:  CMake support in Eclipse CDT
Gesendet von:        cdt-dev-bounces@xxxxxxxxxxx


On Monday, September 21, 2015 14:08:21 Doug Schaefer wrote:
> We will be adding CMake to CDT proper using the new build framework in
> Neon/CDT 9.0. CMake is a critical build system and support for it needs to
> ship with CDT to reach the most people. We¹d love your contributions but
> we do need to wait a couple of weeks or so to get the framework more
> understood and stable

that's cool.

Is there somewhere more documentation what's planned ?

I wrote the Eclipse-CDT-generator in CMake, and the one thing which really
causes a lot of issues is the following:
CMake strongly recommends to use out-of-source builds.
This implies that cmake should never generate any files in the source
So the CDT .project and .cproject files will be generated in the build
Now Eclipse does not like that, since it assumes that the .project file is
always at the root of the project, including all source files.
Since this is not the case in such a setting, various things don't work: the
VCS-plugin is not active (since the builddir is not in svn or git), when
adding the source tree as additional project, files are found twice (since the
source dir is also included as linked resources in the build.dir project),

In my simplistic view all these issues would be fixed if the .project file
could contain a tag like <project_root>...path to the source
dir</project_root>, and then use this instead of the directory of the .project
file as the project root dir.

Do you have an opinion on that ?


cdt-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top