[CMake] cmake support Eclipse

Iain Hull Iain.Hull at cr2.com
Wed Aug 1 05:11:46 EDT 2007


I also think that Cmake, Ant and Eclipse are complementary.  Each does
an excellent job for what it is designed to do.  

I would extend Mikes list of features for Cmake eclipse integration:

1) CMakeErrorParser: This would add cmake build errors to the "Problem"
view in eclipse.  This means that when make calls cmake during the
build, if there are errors in the cmake file, these errors appear in the
"problem" view.  Double clicking on a cmake error in the list would
bring the user to the location of the error in the approprte cmake file.

I have a created a proof of concept plugin for this however I currently
do not have time to finish it.  If anyone is interested in looking at
the code to do this send me an email and I will forward it on.

2) A Cmake ant task: This would allow developers to easily call cmake to
generate make files from within an ant script.  Cmake and make are great
at building c++ (and other gcc languages), however for large build env
with lots of project types ant is great at gluing it all together (as
well as just building java).  

We have used ant to automate the build of our (500+) VC++ projects for
the last three years.  I am currently moving some of these projects to
Cmake to support a unix port, my next phase is to integrate Cmake with
our existing ant build.  I am sure I can use an "exec" task but a
dedicated task would be much nicer.

Here is a rough outline of what I mean, there are probably some gaps
here so don't be too critical.

The first task "cmake" calls cmake to generate the make files or
projects.
The second task "cmakebuild" knows what build type cmake has generated
and how to execute that build.

Eg

<target name="buildCPlusPlus">
	<cmake srcdir="cplusplus/source" bindir="cplusplus/buildoutput"
/>
	<cmakebuild bindir="cplusplus/buildoutput" />
</target>

Iain.

-----Original Message-----
From: cmake-bounces+iain.hull=cr2.com at cmake.org
[mailto:cmake-bounces+iain.hull=cr2.com at cmake.org] On Behalf Of Mike
Jackson
Sent: 31 July 2007 15:42
To: Cmake Mailing List; Mike Jackson
Subject: Re: [CMake] cmake support Eclipse

These are my _thoughts_ on what I would like to see as a first cut at
CMake/Eclipse integration.

As someone has already done in the past day, basically have cmake
generate a CDT "Makefile" project that sets up the .project/.cproject
files for eclipse to invoke make on the makefiles that are generated by
Cmake. I think this is going to be the best way to go about this due to
limitations on how a "ManagedMakefile" project is used in Eclipse. Also,
if the include paths can be preset in the eclipse project file based on
what is in the CMakeLists.txt file this is one more added bonus.

Add into the project file the "exectuables" so I don't have to add them
in eclipse each time.

Next, Implement the "ccmake" program as an Eclipse Plugin so that I can
run "ccmake" from within eclipse. The interface that our windows
brethren get with CMakeSetup would suffice for this. This plugin is
written in Java and would use the Eclipse PDE as its project management.

Version 3: Implement some CMake Wizards that would help a cmake newbie
generate a basic CMakeLists.txt file. These wizards are just for basic
projects and help to generate a properly working CMakeLists.txt file.
After that the programmer can use the cmake documentation to
enhance/add-to their cmake files.

All this would be a great start. I agree with an earlier posting about
trying to have eclipse use CMake for its project management. It is going
to be a long difficult road. If the above it completed first, and done
well, then you have a decent chance of getting the CDT project leads
behind CMake. BTW, the project leads do embedded C/C 
++ development so getting them to switch to CMake would be a great
first step.. ;-)

Again, these are just my thoughts on what I would like to see in an
"Eclipse" Generator
-- 
Mike Jackson   Senior Research Engineer
Innovative Management & Technology Services




_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list