Eclipse CDT4 Generator: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
Line 25: Line 25:
     <pre>mkdir /home/eric/certi_build  
     <pre>mkdir /home/eric/certi_build  
           cd /home/eric/certi_build</pre>
           cd /home/eric/certi_build</pre>
</li>
<li> Launch CMake  
<li> Launch CMake  
     <pre>cmake -G"Eclipse CDT4 - Unix Makefiles" ../certi_src</pre>
     <pre>cmake -G"Eclipse CDT4 - Unix Makefiles" ../certi_src</pre>
Line 32: Line 33:
     <li> <tt>certi_build/.cproject</tt></li>
     <li> <tt>certi_build/.cproject</tt></li>
     </ol>
     </ol>
</li>
<li> Import the created project file into Eclipse:
<li> Import the created project file into Eclipse:
     <ol>  
     <ol>  
Line 47: Line 49:
           [[Image:Capture-certi_build-Eclipse.jpg|thumb|center|200px|Eclipse Imported CERTI project]]</li>
           [[Image:Capture-certi_build-Eclipse.jpg|thumb|center|200px|Eclipse Imported CERTI project]]</li>
     </ol>
     </ol>
</li>
</ol>
</ol>


Line 58: Line 61:
<ol>
<ol>
<li> one for version management
<li> one for version management
     This one may be obtained by a normal ''checkout'' using  
     This one may be obtained by a normal ''checkout'' using </li>
<li> one the building
<li> one the building resulting from the imported CMake generated project</li>
<ol>
</ol>


You will find a screen cast describing how to it
You will find a screen cast describing how to it

Revision as of 22:30, 28 October 2007

Eclipse CDT 4.0 Generator

CMake generated Eclipse Project for TSP
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:

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

  1. Create a build directory and goes there
    mkdir /home/eric/certi_build 
              cd /home/eric/certi_build
  2. Launch CMake
    cmake -G"Eclipse CDT4 - Unix Makefiles" ../certi_src

    After that you will find two eclipse file in your build tree:

    1. certi_build/.project
    2. certi_build/.cproject
  3. Import the created project file into Eclipse:
    1. Launch eclipse
    2. Import project using Menu File->Import
      Eclipse Menu->File->Import
    3. Select Existing projects into workspace:
      Existing Projects into Workspace
    4. Browse where your build tree is and select the root build tree directory
      Eclipse Import after build tree selection
    5. You get a fully functionnal eclipse project
      Eclipse Imported CERTI project

Using Eclipse CDT4 Generator (CVS enabled project)

There is a limitation of the CMake CDT4 Eclipse generator when your source tree is handled by a versioning system (like CVS, Subversion or other) you may read the referred discussion in the link below.

A may acceptable solution is to have 2 projects:

  1. one for version management This one may be obtained by a normal checkout using
  2. one the building resulting from the imported CMake generated project

You will find a screen cast describing how to it here: CMakeEclipseCDT4andCVS-2.ogg

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:

  1. Trouble with CMake + Eclipse + SVN/CVS
  2. *Updated* Eclipse CDT4 CMake Generator - Pre-Alpha version



CMake: [Welcome | Site Map]