[CMake] CDT generator help: path discovery and other items

Dixon, Joel L. JOEL.L.DIXON at saic.com
Tue Jun 4 10:06:55 EDT 2013


Alex,
For the first issue of the indexing paths, I'm at a loss.  I tried to recreate the problem in a new project and never could.  I even finally took my project, copied it elsewhere, and went through the same exercise, again to no avail.  If I'm ever able to reproduce it, I'll try to capture what happened.

As for the filter issue, I'm attaching before and after versions of the .project file where I add two kinds of filters: the first is for *directories-only* called "CMakeFiles", and the other is for *files-only* called "cmake_install.cmake".  It has options to match for directories-only, files-only, or files-and-or-directories.  This seems to be represented by an integer property called "type".  Eclipse seemed to make many other minor changes to the .project file, but look for the filters section near the bottom in a section called "<filteredResources>".

-Lee


-----Original Message-----
From: cmake-bounces at cmake.org on behalf of Alexander Neundorf
Sent: Mon 6/3/2013 3:44 PM
To: cmake at cmake.org
Cc: Dixon, Joel L.
Subject: Re: [CMake] CDT generator help: path discovery and other items
 
On Monday 03 June 2013, Dixon, Joel L. wrote:
> I'm new to CMake, and loving it.  I'm using version 2.8.11 and have a
> couple issues with the CDT generator.
> 
> 
> 
> First, there's really no definitive help (that I've found) for the CDT
> generator.  The HTML generator just simply mentions the generator, it
> doesn't mention any of the options that I've stumbled upon in mentions out
> on the open web, such as:
> 
>   CMAKE_ECLIPSE_MAKE_ARGUMENTS=<>
> 
>     You can use this to add things such as "-j4" to increase the number of
> parallel jobs during builds
> 
>   CMAKE_ECLIPSE_VERSION=<>
> 
>     Setting this to "3.7" for my CDT version made a difference.
> 
> 
> 
> Are there others?  Where are they documented?

They are cache variables. All variables related to the Eclipse generator start 
with "CMAKE_ECLIPSE_".
I recommend you use cmake-gui, then you see all CMAKE_ECLIPSE_* variables.
Putting the mouse cursor above the variable shows documentation for the 
variable in a tooltip. For the versions there is a combobox which provides 
only the supported versions.

Beside that, you are right that the variables are undocumented.
All of them are set in Modules/CMakeFindEclipseCDT4.cmake. You may have a look 
in that file.


> The only official help I've found was at
> http://www.cmake.org/Wiki/Eclipse_CDT4_Generator, and this seems to be
> quite out of date.
> 
> 
> 
> Secondly, path discovery wasn't nearly automatic.  Even after a build,
> opening a C++ file showed unresolved inclusions for every STL include
> (such as <iostream>)  It took me a while, but I finally found that going
> to the Project Properties, then "C/C++ project paths", "Path Containers",
> "Add..." and adding the "Discovered scanner configuration scanner" and
> doing a fresh build and Index rebuild that everything was fine.

This should work.
Can you try this with a "Hello world"-style project and send me the resulting 
.cproject file ?
Maybe also the CMakeCache.txt.

> Finally, doing any edits to the project from WITHIN Eclipse are lost
> whenever having to re-run cmake.  For example, adding project filters to
> hide "CMakeFiles", Qt4 files (such as *.moc, ui_*.h, etc), these filters
> are lost if you have to rerun cmake when adding a new source file to the
> project.

Yes, the .project and .cproject files are completely regenerated on each cmake 
run.
How do you want to hide CMakeFiles/, in which places is this hidden then ?
Can you again, create a "Hello World"-style project, manually add a filter for 
CMakeFiles/, and send me the .project and .cproject files ?
(this can be the same files as above).


Eclipse does have some issues, where cmake simply cannot help.
Some settings are stored neither in the .project nor in the .cproject files, 
but inside the workspace metedata, which cmake cannot touch (because it is 
somewhere else, it is binary, undocumented, etc.).

Also, Eclipse only open the version control plugins inside the project 
directory. Now with cmake out-of-source builds the project files for Eclipse 
are generated in the build tree, not in the source tree, and Eclipse doesn't 
see version control files there, so it never opens the version control 
plugins. I would naively assume that it shouldn't be too hard to add an entry 
SourceRootDir or something like that to the .project file, which, if set, 
would then be used instead of the directory of .project. Then cmake could 
simply write that tag into the .project file and Eclipse would be able to 
handle it. But for that it needs somebody deep in Eclipse to add support for 
that inside Eclipse.


Alex
--

Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130604/715ac535/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: project-before
Type: application/octet-stream
Size: 4860 bytes
Desc: project-before
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130604/715ac535/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: project-after
Type: application/octet-stream
Size: 5231 bytes
Desc: project-after
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130604/715ac535/attachment-0003.obj>


More information about the CMake mailing list