[CMake] eclipse generator and code completion

Antoine DUCHAMPS antoine.duchamps at gmail.com
Mon May 4 12:03:45 EDT 2009


Le lundi 04 mai 2009 à 08:24 -0400, Miguel A. Figueroa-Villanueva a
écrit :
> On Mon, May 4, 2009 at 6:01 AM, Eric Noulard wrote:
> > 2009/5/4 Antoine DUCHAMPS:
> >> Le lundi 04 mai 2009 à 10:36 +0200, Eric Noulard a écrit :
> >>> 2009/5/4 Antoine DUCHAMPS:
> >>> >
> >>> > However, the code completion does not work. My application is linked to
> >>> > an external library (ITK) and I would like to have code completion for
> >>> > the ITK classes. In kdevelop you have to import the folders containing
> >>> > the .h files. Do you know how it works in eclipse?
> >>>
> >>> You have to add the folder containing the .h files in the list of
> >>> "includes" for the project.
> >>> Use
> >>>
> >>> Properties on the Project
> >>>    --> C/C++ General
> >>>          --> Path and Symbols
> >>>               --> C++
> >>>
> >>> works for me, "most of the time", I say most of the time since I do have
> >>> some C++ header bloated with macros for which completion does not work at all.
> >>>
> >>
> >> Hi Eric,
> >>
> >> It doesn't work for me. I'm not sure if we are doing the same ... In my
> >> eclipse version I indicated the include folder by doing
> >>
> >> Project -> Properties -> C++ include paths and symbols -> Add External
> >> Include Path ...
> >
> > I have no "C++ include paths and symbols" .
> > Here comes a screenshot.
> > Note however I'll suggest we drop CMake ML on the next e-mail since the problem
> > is not really related to CMake.
> 
> Eric, maybe I'm missing something in your use case, but if you think
> that the eclipse generator should automatically handle this, then it
> is relevant here.
> 
> If not, then please explain why this is a specific issue for your use
> case that shouldn't be handled generally.
> 
> > Whatever your eclipse/CDT version
> > you may need to force "Rebuild index" after that:
> >
> > Contextual Right Click on the Project
> >
> >     Index ---> Rebuild.
> 
> If this (the Rebuild) solves Antoine's problem, then it seems to me
> that would solve it from an IDE stand-point, but the generator should
> include this automatically (see my other reply to this thread).
> 
> Thanks,
> --Miguel

Hi Miguel,

I couldn't test the Rebuild index proposed by erik because I cannot find
it after right clicking in my eclipse CDT version (3.1.2)

I also tried by using include_directories in the CMakeLists.txt but code
completion does not work either. However, the specified folder appears
as included folder in the project properties ...

Which version of eclipse CDT do you have? Perhaps I should update
eclipse, but I'm using the default version in debian 5.0 ...

thanks!

Antoine.

 






More information about the CMake mailing list