[CMake] Patch for Eclipse generator

a.neundorf-work at gmx.net a.neundorf-work at gmx.net
Sun Oct 21 18:34:14 EDT 2007


On Monday 22 October 2007 00:19, Pau Garcia i Quiles wrote:
> Quoting a.neundorf-work at gmx.net:
> > 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.
>
> Yes. I agree it does not sound too good but we would be on-track again
> to the CMake-ish way of doing 100% pure out-of-tree builds.
>
> I have not considered it seriously but I think we may only need to
> create symlinks to the first level of files and folders, 

Ah, ok.
But the directories will already exist as real directories in the build tree 
in many cases (if they contain CMakeLists.txt), so you can't symlink them. Am 
I missing something ?

...
> Could you please explain what's the benefit of having two projects,
> one for the source version control and another one for generating the
> files out-of-tree?

It should be possible to have multiple build trees with eclipse projects for 
one source tree. Does this work with your approach ?
I'm not sure creating the symbolic links won't introduce problems, e.g. when 
searching for headers in the include path, with the symbolic links there may 
be directories which are not there with other generators.

Bye
Alex


More information about the CMake mailing list