[CMake] Patch for Eclipse generator

a.neundorf-work at gmx.net a.neundorf-work at gmx.net
Sun Oct 21 17:35:25 EDT 2007


Hi,

On Sunday 21 October 2007 00:48, you wrote:
...
> > Just to make sure I understand:
> > with this patch the two eclipse project files are always created in
> > the source tree, right ?
>
> Right.
>
> > What happens if you try to create two buildtrees for one source tree,
> > which problems may appear ?
>
> With my current patch, it's not possible due to Eclipse limitations.
>
> The only way I can think to fix this is to create soft links to the
> files and folders in the source tree, then create the .project and
> .cproject in that folder. It'd be something like this:
>
> myhelloapp/CMakeLists.txt
> myhelloapp/src/CMakeLists.txt
> myhelloapp/src/hello.cpp
> myhelloapp-build/.project
> myhelloapp-build/.cproject
> myhelloapp-build/src -> myhelloapp/src/hello.cpp
> myhelloapp-build2/.project
> myhelloapp-build2/.cproject
> myhelloapp-build2/src -> myhelloapp/src/hello.cpp
>
> where "->" means that's a symlink.
>
> This would probably work fine on Unix platforms and probably Windows
> 2000 and 2003 (using linkd for the symlinks). I'd have to test this,
> though.

I.e. creating a symlink for each source file and each folder ?
Hmm, creating potentially thousands of symlinks doesn't sound too good.

How about that:

If you run cmake in-source, everything should just work.

If you run cmake out-of-source, cmake creates two eclipse projects: one 
project in the source tree, where you can't build anything, but which you 
should import in eclipse to have version control working, and the actual 
project in the build tree, where you build stuff (but don't have version 
control). The in-source version control project only would have to be created 
if it doesn't exist yet. 
What do you think about this ?

Bye
Alex


More information about the CMake mailing list