Eclipse CDT4 Generator: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
(Replace content with link to new CMake community wiki)
 
(40 intermediate revisions by 12 users not shown)
Line 1: Line 1:
==Eclipse CDT 4.0 Generator==
{{CMake/Template/Moved}}


[[Image:CMakeEclipseCDT4_TSPBuild.png|thumb|right|350px|CMake generated Eclipse Project for TSP]]
This page has moved [https://gitlab.kitware.com/cmake/community/wikis/doc/editors/Eclipse-CDT4-Generator here].
 
[[Image:CMakeEclipseCDT4GeneratorScreendump.png|thumb|right|350px|Eclipse opens CMake project file]]
 
There is an Eclipse CDT 4.0 generator being developed on top of the Makefile generators available now (i.e., "Unix Makefiles", "MinGW Makefiles", "MSYS Makefiles", and maybe "NMake Makefiles").
 
With this generator it is possible to create a set of .project/.cproject files that can be imported in Eclipse as an "Existing Eclipse project".
 
Since August 1st the Eclipse generator is included in CMake cvs.
 
If you would like to monitor the changes to the EclipseCDT4 support, you can view the following links which contain the cvs history log for changes to the two main files:
* [http://www.cmake.org/cgi-bin/viewcvs.cgi/Source/cmExtraEclipseCDT4Generator.h?root=CMake&view=log cmExtraEclipseCDT4Generator.h]
 
* [http://www.cmake.org/cgi-bin/viewcvs.cgi/Source/cmExtraEclipseCDT4Generator.cxx?root=CMake&view=log cmExtraEclipseCDT4Generator.cxx]
 
==Using Eclipse CDT4 Generator==
Using the Eclipse CDT4 generator is not different as using another CMake generator.
In this example I assume the source tree of my project
is ''/home/eric/certi_src''
 
<ol>
<li> Create a build directory and goes there
    <ol>
    <li>''mkdir /home/eric/certi_build''
    <li>''cd /home/eric/certi_build''
    </ol>
<li> Launch CMake
    <ol>
    <li> cmake -G"Eclipse CDT4 - Unix Makefiles" ../certi_src
    </ol>
After that you will find two eclipse file in your build tree:
    <ol>
    <li> certi_build/.project</li>
    <li> certi_build/.cproject</li>
    </ol>
<li> Import the created project file into Eclipse:
    <ol>
    <li> Launch eclipse</li>
    <li> Import project using Menu ''File->Import''
          [[Image:Capture-EclipseMenuFileImport.jpg|thumb|center|200px|Eclipse Menu->File->Import]]</li>
 
    <li> Select ''Existing projects into workspace'':
          [[Image:Capture-EclipseProjectsIntoWorkspace.jpg|thumb|center|200px|Existing Projects into Workspace]]</li>
 
    <li> Browse where your build tree is and select the root build tree directory
          [[Image:Capture-Import.jpg|thumb|center|200px|Eclipse Import after build tree selection]]</li>
 
    <li> You get a fully functionnal eclipse project
          [[Image:Capture-certi_build-Eclipse.jpg|thumb|center|200px|Eclipse Imported CERTI project]]</li>
    </ol>
</ol>
 
==Using Eclipse CDT4 Generator (CVS enabled project)==
 
For using a
 
==Discussion about Eclipse CDT4 Generator limitations==
 
Eclipse assume project files (i.e. .project and .cproject) ''must
be at the root of the project tree'' '''and''' a project
may be handled by a versioning system (CVS, SVN, ...) iff
''the root project tree is''.
 
This assumption clashes with the fact that CMake generated files
should ''stay in the build tree'' whereas source files (which are usually those handled
by a versioning system) reside ''in the source tree''.
 
There has been a fair amount of discussion regarding this '''problem'''
of the Eclipse CDT4 Generator:
<ol>
<li>[http://www.cmake.org/pipermail/cmake/2007-October/016956.html Trouble with CMake + Eclipse + SVN/CVS]
<li>[http://www.cmake.org/pipermail/cmake/2007-August/015504.html *Updated* Eclipse CDT4 CMake Generator - Pre-Alpha version]
</ol>
{{CMake/Template/Footer}}

Latest revision as of 15:41, 30 April 2018


The CMake community Wiki has moved to the Kitware GitLab Instance.

This page has moved here.