[CMake] Eclipse/CMake projects show same file multiple times

Alexander Neundorf a.neundorf-work at gmx.net
Thu Mar 7 16:15:44 EST 2013


On Thursday 07 March 2013, Campbell Barton wrote:
> With default Eclipse project (version 2.8.10.2), "Eclipse CDT4 - Unix
> Makefiles", I get the same file showing multiple times when using
> Open-Resources.
> 
> It also shows object files in the listing (.o) which is fairly
> annoying and makes Open-Resources not that useful.
> 
> Example screenshot:
> http://www.graphicall.org/ftp/ideasman42/eclipse_cmake_project.png
> 
> Is this a known problem?, Should I report a bug?

Set the cmake variable CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES to FALSE (since 
2.8.10 I think, it's in the cache) to FALSE, and see whether this is better 
for you.

Also, please try 2.8.11, for which RCs will be out really soon now. This has 
an additional change which has to do with this.

Eclipse does have some weird behaviour.
It would be nice if I could tell Eclipse to ignore linked resources e.g. when 
searching, so it doesn't show the same file multiple times, or if Eclipse 
would figure out that the linked resources actually references the same file 
multiple times, but it doesn't.
There is an Eclipse setting to ignore linked resources when searching, but 
this setting is not in the project file, so cmake can't set it :-/

Also Eclipse is not able to handle out-of-source projects, and in theory this 
should be simple. Just add an entry to the project file which points to the 
source directory and use that one.

It would be great if somebody could try to get patches for that Eclipse.

Alex


More information about the CMake mailing list