[CMake] Eclipse CDT4 CMake Generator - Pre-Alpha version

Eric Noulard eric.noulard at gmail.com
Wed Aug 1 07:48:37 EDT 2007


2007/8/1, Eric Noulard <eric.noulard at gmail.com>:
> 2007/7/31, Miguel A. Figueroa-Villanueva <miguelf at ieee.org>:
> >
> > Attached is the file. I changed some variable names and other minor
> > things, but I'm not certain it follows all the coding standards. I
> > leave that to your inspection, although please point out whatever you
> > find that you needed to fix for my future reference.
>
> Yeah just great.
> I have  tried your patch on a fresh CMake CVS HEAD update and
> it works just fine for me for TSP.
>
> My test is:
>
> 0) mkdir TestCMakeCDT
>     cd TestCMakeCDT
>
> 1) checkout TSP
>     cvs -z3 -d:pserver:anonymous at cvs.savannah.nongnu.org:/sources/tsp co tsp
>
> 2) Generate Eclipse project
>    mkdir Build_tsp_generated
>    cd Build_tsp_generated
>    cmake -G"Eclipse CDT4 - Unix Makefiles" ../tsp
>
> 3) From within Eclipse --> Import Existing Project
>     etc ...
>
> > All of those interested in this development are encouraged to watch
> > the following wiki page:
> >
> > http://www.cmake.org/Wiki/Eclipse_CDT4_Generator_Development
>
> I did add another screenshot :))
>
> I have somes remarks:
>
> 1) The referred sources for the build are a cvs checkout
>    but they do not appear as such in Eclipse,
>    i.e. the Team menu is not enabled. :((
>   May be the CVS Eclipse plugin did not automagically
>   discover this fact because not all the project structure
>   is handled by CVS but only the link resource refering
>   to the source tree.
>
>   I've tried to "manually" activate Team menu on this
>   particular folder but I am still unable to do it without
>   "Sharing" the whole project which is definitely not what
>   I want since the build tree should not be handle by CVS.

I did ask a question about this issue on the eclipse-cvs ML:
http://dev.eclipse.org/mhonarc/lists/platform-cvs-dev/msg00452.html

> 3) There seems to be a spurious binary named a.out
>     which is discovered the file is:
>     Build_tsp_generated/CMakeFiles/CompilerIdC/a.out

For another CMake enabled-project which use both C and C++
I even have 2 spurious a.out file, one for C and one for C++
I think you may fix this trouble by Adding
<build_tree_root>/CMakeFiles
to the exclusion list to out
just as you did for the link ressource.
This may be achieved by adding "CMakeFiles" in the list of exclusion
og the "out" pathentry kind.
In my case this is located in this region of the ".cproject" file:

<storageModule moduleId="org.eclipse.cdt.core.pathentry">
<pathentry kind="src" path="TSP"/>
<pathentry excluding="TSP/|CMakeFiles/" kind="out" path=""/>

Another remark I would like to add is the fact that
in the "Make Target" list the "default" all target does not appear
may be because it is not listed by the loop you use:
for(cmTargets::const_iterator t = targets.begin(); t != targets.end(); ++t)

I think it may be useful to add it since it enables the all build
on one click just as "Ctrl-B" does.
May be clean may be useful too.

One question pops-up to my mind.
CMake may be invoked by make (when a CMakeLists.txt changes)
thus the .project and .cproject will be regenerated.
How Eclipse/CDT will behave when its projects files are modified
"behind the wall"?

I did some tests and it seems that a simple refresh is OK
but it may be worth examining this more accuratly.

-- 
Erk


More information about the CMake mailing list