[CMake] Eclipse generator question

Benjamin Shadwick benshadwick at gmail.com
Wed Apr 3 16:26:59 EDT 2019


I tried cmake4eclipse, and it's a mixed bag. It requires a lot of tweaking
of the Eclipse project after you create it, and I'm pretty sure it suffers
from the same problem of leaving you with an Eclipse project whose source
tree reflects what is in the filesystem rather than what is defined in the
CMake project.

It's really annoying that I spent all this time building a CMake project
for a complex codebase, only to have the IDE present and index the entire
source tree on the filesystem instead of the subset that is actually being
built by the CMake configuration.

I should probably enhance my project-tweaking python script to add filters
to the generated Eclipse project to hide anything that isn't in the CMake
project.

On Wed, Apr 3, 2019 at 1:02 PM Martin Weber <fifteenknots505 at gmail.com>
wrote:

> Am Mittwoch, 3. April 2019, 18:44:04 CEST schrieb Benjamin Shadwick:
> > Update - I think I found a tolerable workaround:
> >
> > If I invoke cmake with -DCMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES=OFF and
> > then inject a link to my include directory into the .project file, things
> > work a lot better:
> > - I get only one copy of each source file in the Open Resource dialog.
> > - I get source and header files in the Open Resource dialog.
> > - I can toggle between source and header.
> > - I can build from Eclipse.
> > - I get version control support, even in my include tree.
> > - Indexing is fast.
> >
> > It seems that Eclipse improved version control support quite a bit since
> > the CMake Eclipse generator was last touched. Unfortunately this seems to
> > also mean that a lot of the linked resources that CMake generates by
> > default now just add noise (hence my better results from turning them
> off).
>
> Newer versions of CDT (9.1+) seem to have trouble to properly read the
> .cproject file generated by cmake [1] [2].
>
> Forget about running cmake manually and install _cmake4eclipse_ from the
> eclipse marketplace. It runs cmake automatically [3] and comes with
> support
> for the eclipse indexer. Some people even use it for CUDA in the nvidia
> insight IDE. (Disclaimer: I am the maintainer)
> Just try it with one of the example projects [4].
>
> Martin
>
> [1] <https://cmake.org/pipermail/cmake-developers/2019-March/031125.html>
> [2] <https://www.eclipse.org/forums/index.php?
> t=msg&th=1094239&goto=1797891&#msg_1797891>
> [3] https://github.com/15knots/cmake4eclipse#design-goals
> [4] https://github.com/15knots/cmake4eclipse-sample-projects
>
>
> --
> Cd wrttn wtht vwls s mch trsr.
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190403/84971a59/attachment.html>


More information about the CMake mailing list