Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Indexer Problems when using eclipse CDT with Cmake
Indexer Problems when using eclipse CDT with Cmake [message #1792301] Sun, 15 July 2018 17:13 Go to next message
Kevin Thomas is currently offline Kevin ThomasFriend
Messages: 3
Registered: July 2018
Junior Member

down vote
favorite
I have problems with the Index responsible for autocomplete and live code correction in eclipse CDT. When I setup an Eclipse project using the in eclipse CMAKE tools (New Project=>CMake Project) the indexer simply doesn't work and can't find any files outside the source directory (It can't find library headers, even the ones on /usr/).
It does sometimes kinda work if the inlcude_directory is set directly without usage of a variable, but its pretty random:
# this sometimes works
include_directories("/home/user/lib/test")
# this never does
set(PATH /home/marvin/Documents/trash)
include_directories(${PATH})

so is there a way to configure eclipses Index manually? So I can just add resource paths or something for the Indexer directly, so I can have code completion?
Re: Indexer Problems when using eclipse CDT with Cmake [message #1792340 is a reply to message #1792301] Mon, 16 July 2018 09:29 Go to previous messageGo to next message
David VavraFriend
Messages: 778
Registered: October 2012
Senior Member
Yes, it can be manually configured.
http://help.eclipse.org/photon/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fconcepts%2Fcdt_c_scanner_discovery.htm
https://help.eclipse.org/photon/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_general_scanner_discovery.htm?cp=13_4_7_0_4_6

System library headers are usually found by the builtins provider.
The BOP expects to be able to see the compiler calls in the build log to get include paths and compile line macros.
CMake sometimes hides these.

You can always add User entries.

The CMake plugin, assuming you are using one, may provide other methods.
Consult the appropriate documentation for it.

[Updated on: Mon, 16 July 2018 09:42]

Report message to a moderator

Re: Indexer Problems when using eclipse CDT with Cmake [message #1792358 is a reply to message #1792340] Mon, 16 July 2018 12:37 Go to previous messageGo to next message
Kevin Thomas is currently offline Kevin ThomasFriend
Messages: 3
Registered: July 2018
Junior Member
I'm not using a plugin, CMake functionalty is baked into eclipse CDT .
Also these are the only options provided by Eclipse when I create a CMake Project using the builtin template:

https://i.imgur.com/5crILq1.png
Re: Indexer Problems when using eclipse CDT with Cmake [message #1792373 is a reply to message #1792358] Mon, 16 July 2018 15:06 Go to previous messageGo to next message
Doug Schaefer is currently offline Doug SchaeferFriend
Messages: 132
Registered: July 2009
Senior Member
CDT gets all the compile commands and options from the compile_commands.json file in the build directory. If everything looks right there for you, please raise a bug and we can take a look.
Re: Indexer Problems when using eclipse CDT with Cmake [message #1792388 is a reply to message #1792373] Mon, 16 July 2018 18:42 Go to previous messageGo to next message
Kevin Thomas is currently offline Kevin ThomasFriend
Messages: 3
Registered: July 2018
Junior Member
No the compile is completely fine, I have issues with the autocomplete and autocorrect, which can't seam to find the headers from the cmake file. I'm looking for a way to configure the Indexer manually
Re: Indexer Problems when using eclipse CDT with Cmake [message #1792615 is a reply to message #1792301] Fri, 20 July 2018 09:13 Go to previous message
Carlos Posse is currently offline Carlos PosseFriend
Messages: 1
Registered: July 2018
Junior Member
I'm experiencing exactly the same issue. I can compile the project just fine with eclipse, using cmake and ninja. The compile_commands.json is created correctly, but I just can't find a way to configure the indexer to use the CMAKE_EXPORT_COMPILE_COMMANDS, or any other discovery setting. The menu just isn't there, and I can't find any workaround.
Previous Topic:Post-build steps - Get preprocessor symbols and include path
Next Topic:Can't debug (Windows 10)
Goto Forum:
  


Current Time: Wed Sep 26 10:28:21 GMT 2018

Powered by FUDForum. Page generated in 0.02382 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top