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

On Tuesday, October 06, 2015 18:04:41 Martin.Runge@xxxxxxxxxxxxxxxxx wrote:
> Hi Alex,
> 
> I adopted
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=350206
> and expanded it silently to full cmake support, not just scanner
> discovery. The current state of the implementation is hosted here:
> https://github.com/rungemar/cmake4cdt
> 
> I agree with what you said about the "one thing causing lot of issues".

Is there a chance this could be "fixed" ?
I know CDT is a separate subproject of Eclipse, but I have no idea how strong 
the separation/the ties are.

> My approach is like this:
> - .project and .cproject stay at the projects root and can be checked in
> (new project type: CMake project)

if I understand correctly, the directory layout is something like this:

yproject/
myproject/.project
myproject/.cproject
myproject/src/
myproject/build-debug/ 
myproject/build-release/ 
myproject/build-whatever/ 

In which directory is the top-level CMakeLists.txt located ?

> -->  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?

Not quite sure I understand:
switching between make and ninja in one build tree is not possible, so 
separate build trees are required if somebody wants to have a build with make 
and another one with ninja.
Or are you just wondering whether supporting ninja is actually necessary in 
Eclipse ?


> - 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.

There is "currently" work going on to extend cmake in that direction, i.e. not 
only generated the compile_commands.json file, but much more ("currently" 
because the discussions on the cmake-devel list are a few months ago, but 
Steven is working on it). Maybe that's interesting for you.
 
Alex



Back to the top