[CMake] Trouble with CMake + Eclipse + SVN/CVS

Pau Garcia i Quiles pgquiles at elpauer.org
Wed Oct 17 10:21:08 EDT 2007


Quoting Eric Noulard <eric.noulard at gmail.com>:

> 2007/10/17, Pau Garcia i Quiles <pgquiles at elpauer.org>:
> [...]
>>
>> Is it possible to use CVS or SVN from Eclipse in a CMake-generated
>> project in scenarios A or B?
>
> This is an Eclipse Team platform issue.
> You may read more information about it
>
> here
> http://www.cmake.org/pipermail/cmake/2007-August/015510.html
> and
> here
> http://dev.eclipse.org/mhonarc/lists/platform-cvs-dev/msg00452.html
>
> read those threads then you'll that A or B are not possible yet.
> You may create 2 Eclipse project
> the first being a "simple" checkout of your sources done
> with eclipse
> the second being the CMake generated project.

Thank you.

After reading those threads, I have been able to make
scenario A (out-of-tree build) work with a bit of manual work.

I am trying to modify the Eclipse generator to perform the changes  
automatically and will provide a patch.

In case anybody is interesting, it is quite easy to get it to work.
Assuming you have got a 'myapp' directory:
1. Create a 'myapp-build' directory at the same level 'myapp' is
2. From 'myapp-build', run 'cmake -G "Eclipse CDT4 - Unix Makefiles ../myapp'
3. Move .cproject and .project from 'myapp-build' to 'myapp' (I know,
I know: not a pure out-of-tree build anymore, but this is the only
"pollution" your tree will get)
4. Edit .project and:
     * At the top of the file, change <name>myapp-build</name> to
<name>myapp</name>
     * At the end of the file, in <linkedResources> -> <link> change
<name>myapp</name> to <name>myapp-build</name> and
<location>yourpath/myapp</location> to
<location>yourpath/myapp-build</location>
5. Edit .cproject and:
     * Change <target name="myapp" ... to <target name="myapp-build" ...
     * Change <buildTarget>myapp</buildTarget> to
<buildTarget>myapp-build</buildTarget>

Now you have out-of-tree builds with CMake in Eclipse and CVS and SVN  
work fine (more than fine, actually: when you try to import your  
source into CVS or SVN, no generated file shows in the file selector).  
Remember to add myapp/.cproject and myapp/.project to the .cvsignore  
or to svn:ignore for them not to be in the repository.

The only flaw I have seen so far is Eclipse shows this warning in the  
Problems tab:
* Description: "Invalid project path: Missing project folder or file  
/myapp/myapp for Source path."
* Resource: myapp
* Path: (empty)
* Location: pathentry

But everything works fine for me.

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)






More information about the CMake mailing list