[CMake] Fwd: Re: Survey: Are you using the Eclipse CDT Generator?

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Wed Jul 16 10:41:38 EDT 2008


On Wed, Jul 16, 2008 at 9:48 AM, Mehdi Rabah wrote:
> On Wed, Jul 16, 2008 at 11:52 AM, Mike Arthur wrote:
>>
>> On Tuesday 15 July 2008 02:52:44 Miguel A. Figueroa-Villanueva wrote:
>> > This is just a simple survey to get an idea if there are many people
>> > successfully using the Eclipse CDT generator that has been out there
>> > for a while. Not many bugs appear to be surfacing, so either it's in
>> > pretty good shape or nobody is using it... ;)
>> I was using it for a while but went back to creating my own projects using
>> the
>> Makefile generator. I thought you might like feedback as to why I did so.
>>
>> 1) I found it a bit annoying that the source tree was not the default
>> location
>> and instead was a linked directory. To me it makes more sense to have the
>> build directory linked as you are more likely to be editing stuff in your
>> source directory than your build directory.
>
> This point also annoy me little, especially because I'm using svn and bzr
> plugin that are not being called when moving files from the build project,
> but you get used to it easily (you just have to rename and move files in the
> original). Having the automatic completion working out-of-the-box is worth
> this little bug.

Mike,

Yes, I was very annoyed at this... actually I was also very annoyed at
not being able to have nested projects! But this is an eclipse
limitation. I can only have access to a directory that is not directly
beneath the .project file through a linked resource and if I put the
.project/.cproject in the source dir, then I can't have different
build types. That is, if you want to have more than one build with
different configurations (say, debug and release) you would need two
source checkouts.

However, I do want to point you to the latest addition I made that
works around this to a certain extent. It would be nice if you could
test it and provide some feedback, even if you don't stick to it.

I added a feature to support source control by adding a project in the
root of the source tree. However, it is a simple project to get source
control working and the regular project continues to be out-of-source
(if that is what you chose, of course). The drawback is that now you
have to import two projects instead of one. But then, this lets you
have several build configurations in a project.

The best way I have found of working is to have the build directories
as siblings and not in a subdirectory (another eclipse annoyance). So,
if you have the following structure:

project/src
project/bin-release
project/bin-debug

You can do:

cd project/bin-release
cmake -G"Eclipse CDT4 - Unix Makefiles"
 -DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE
 -DCMAKE_BUILD_TYPE=release ../src

cd project/bin-debug
cmake -G"Eclipse CDT4 - Unix Makefiles"
 -DCMAKE_BUILD_TYPE=debug ../src

And then you import the three generated projects to eclipse and all
should be working nicely.

This is explained here:

http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

Well, we have attempted to explain it, but improvements are always welcom ;)

>> 2) It's good that all the rules are setup using Makefiles but I'm not
>> quite
>> sure why the "build" buttons seem to be disabled in favour of this. It
>> would
>> be good to have them re-enabled or at least an option so, if you'd like
>> the
>> default Eclipse behaviour (build button = make all) then you can have it
>> easily.
>
> I guess the build button is disabled because there are no configurations
> (you're not in a managed project), but if you want a shortcut to build your
> project, just hit ctrl-B

If any of you figure out the xml necessary to make the build button
select a default target, I can add it. Browse your current .cproject
and if you find anything let me know.

Thanks for the feedback.

--Miguel


More information about the CMake mailing list