[CMake] CMake and eclipse

Mike Jackson imikejackson at gmail.com
Sun Feb 3 12:53:23 EST 2008


I gave that plugin a try out and while it is nice to graphically  
"see" the structure of a CMake file there did not seem to be any  
actual project management or any other features that I could figure out.

I work with CMake and Eclipse (On OS X and Linux 64) all day long.  
You have already heard from one individual on his project setup so I  
will throw mine in.

http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial

Basically I primarily use the terminal with cmake/ccmake to generate  
the makefiles for my system, then use Eclipse in "Makefile Project"  
mode to do the actual development of code and compilation. As long as  
you are using a compiler that Eclipse understands, Eclipse will parse  
the compiler output and display errors and warnings for you.

I find this works very well for my needs.

I do second the idea of using <http://www.cthing.com/CMakeEd.asp> for  
a nice CMake editor. Within eclipse there are ways to create  
"External Tools" that could possibly bootstrap the whole process if  
needed.

When working with Eclipse I _strongly_ recommend you put your build  
directory inside the top level of your project. Eclipse seems to work  
better that way. In the latest CMake CVS there are eclipse project  
generators. You are welcome to give those a try to see if they gel  
with your project layout needs.

My basic Project setup is:

-Project
   -src // All source files
   -Resources // All extra files the project needs
   -Build // Run cmake from in here (cmake ../)

This works for _me_ in my situation. My projects can be viewed here:  
<http://titanium.imts.us/>. Also, a small bit of advice for those new  
to CMake: Watch how you name files and folders that might be at the  
top level of your project. Sometimes it is tempting to do something  
like:

-Project
   -src // All source files
   -Resources // All extra files the project needs
   -cmake // Cmake related files in here
   -Build // Run cmake from in here (cmake ../)

Problem with that is at some point you _will_ accidentally run cmake  
from within the project directory. CMake creates _lots_ of its own  
files. All with Cmake somewhere in the name. If you also have a top  
level folder with CMake in the name it can be difficult to figure out  
which files/folders need to be trashed. This is why is use  
"Resources" and then put some of my special cmake files in that folder.

Just FYI. Welcome to the cmake community.
-----------
Mike Jackson


On Feb 2, 2008, at 6:52 PM, Giualian Sander wrote:

> Hi gents,
>
> I'm new to cmake, and I've found a project called CMakeBuilder  
> (www.cmakebuilder.com) across the internet.
>
> I'm a C++/Autohell developer from years (let's says decades !) And  
> I found interesting the visual approach of this tool, especially  
> for understanding CMake structure and syntax.
>
>
> Even if it's beta right now, I think it brings some "easy to learn"- 
> capability to CMake
>
> Do anyone of you know about the upcoming features as described on  
> eclipseplugincentral.com ?
>
> I'm currently in charge of a "from scratch" project, working with a  
> lot of eclipse/C++ developers, and I'm not willing to maintain a  
> AutoHell configuration on such a scale.
>
> Thought I'm conviced that CMake is the right choice for me, is such  
> a plugin a good choice for me ?
>
> Thanks for your advices....
>
> BRgds
>
> Giualian Sander
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/cmake/attachments/20080203/f8cd1d86/attachment.htm


More information about the CMake mailing list