Skip to main content

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

Hi all

In the cmake4cdt plugin, I use the output of cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=on to feed the include paths into the indexer. I just checked that cmake also produces the compile_commands.json file when using the ninja generator (at least on linux).

I do not need to parse the CMakeLists.txt (I dont't think it's feasible) nor CMakeCache.txt files (may be feasible).

From the cmake_compile_commands file, I get the compiler name, its options which can be parsed by the same code as the build output parser.

There is still a loop at one place:
Especially on Windows, cmake may not find the compiler itself or the make tool, because it may not be in the path. Therefore CDT needs to know the path to the compiler prior to the call to cmake -> it may not be sufficient to parse the compiler's name out of any cmake output.

For me/us it's very important to support cross compiling for different architectures, that's where the cmake toolchain files come into the game. If CDT needs to know details about the toolcahin before the initial call of cmake (to find make, gcc, cross-gcc if they are not in the system's PATH) it could generate a cmake toolchain file for cross compiling (not the CMakeLists.txt).
I think, CDT needs to know about a debugger corresponding to the build architecture/configuration to be able to generate launch configurations, right?

I agree with nearly all of the topics metioned earlier:
- CMakeLists.txt written by the user and under version control.
- the steps described by Martin (cmake4cdt also impolements most of them, but get include paths from the json file)
- get the build targets from cmake (by not, CDT lists all binaries, including "a.out",  "CMakeDetermineCompilerABI_CXX.bin", "CMakeDetermineCompilerABI_C.bin" )

We really should manage to join forces, now that we know about each other.

Cheers
Martin

cmake4cdt (work in progress):
binaries available here: http://rungemar.github.io/cmake4cdt/
source: https://github.com/rungemar/cmake4cdt




Von:        Doug Schaefer <dschaefer@xxxxxxx>
An:        CDT General developers list. <cdt-dev@xxxxxxxxxxx>
Datum:        2015-12-03 23:44
Betreff:        [Newsletter] Re: [cdt-dev] CMake support in Eclipse CDT
Gesendet von:        cdt-dev-bounces@xxxxxxxxxxx




My plan is to only support Makefile generation for now. So if we can get something there then we’re good.

From: <cdt-dev-bounces@xxxxxxxxxxx> on behalf of Alexander Neundorf <neundorf@xxxxxxx>
Reply-To:
"CDT General developers list." <
cdt-dev@xxxxxxxxxxx>
Date:
Thursday, December 3, 2015 at 5:03 PM
To:
"
cdt-dev@xxxxxxxxxxx" <cdt-dev@xxxxxxxxxxx>
Subject:
Re: [cdt-dev] CMake support in Eclipse CDT


On Thursday, December 03, 2015 22:53:17 Martin Weber wrote:
> Am Mittwoch, 2. Dezember 2015, 01:21:38 schrieb Doug Schaefer:
> > toolchain definition file to use with CMake. Then how to get the compile
> > options from CMake to feed scanner discovery. Hopefully it’s similar to
> > qmake which I can dump pretty much every variable that feeds into the
> > Makefile generation.
>
> Getting the compile options (preprocessor-macros and include paths) to feed
> the indexer is nearly impossible. Cmake has no option to dump these
> (CMAKE_EXPORT_COMPILE_COMMANDS works only for makefiles). cmake places that
> information in the generated build scripts, which may be makefiles or
> ninja.rules-files or whatever-build-tool files.
> If you want to give end users a choice for the build tool, you will end up
> in writing parsers for these build scripts plus adding mechanics to find
> these.
 
AFAIK the plan here is to read/parse them from the compile commands json file.
The existing CDT-project generator (which is mainly limited by Eclipses stubborness wrt. to the VCS plugin only working in subdirs of the location of the .project file), already puts the compile flags and include dirs into the .cproject file, so CDT knows about them.
What I want to say, CMake can put that information into some file, so it can be used.

> My cmake4eclipse plugin tries to feed the indexer by parsing the build
> output. But that fails on windows or if users chose to use ninja instead of
> make.
>
> IMHO, all IDE developer teams that want to integrate cmake into their IDE,
> should stick heads together, find consent on the required information (at
> least for the C/C++ language) and talk to the cmake team. According to [1],
> they are aware of the problem, but (my guess) they need input from the IDE
> developr side.
>
> I see these IDE developer teams:
> - CDT
> - Kdevelop (<neundorf@xxxxxxx>, already on his list and on the make
> developers list)
 
I'm not part of the kdevelop team.
 
Alex
 _______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Content provided within this e-mail including any attachments, is for the use of the intended recipients and may contain Rohde & Schwarz company restricted information. Any unauthorized use, disclosure, or distribution of this communication in whole or in part is strictly prohibited. If you are not the intended recipient, please notify the sender by reply email or by telephone and delete the communication in its entirety.


Back to the top