I'm currently trying to set up a VTK project that has pre written Cmake makefiles to work with Eclipse. The code that I need to use is in both C++ and Java, but my main concern right now is actually to be able to translate the existing project into something that Eclipse can understand with all the dependencies etc.
Please feel free to ask further questions.
Cheers.
First of all you need the Eclipse CDT package.
Then you need to generate the Eclipse CDT
project: cmake -G "Eclipse CDT4 - Unix Makefiles" /path/to/source/dir
.
The last step you need to do is import the project in the current workspace: File -> Import... -> Existing Projects Into Workspace
.
Configure your project in CMake to use the Eclipse CDT Generator. That will generate the correct makefiles for eclipse.
You also might be interested in reading the follow CMake wiki pages that talk about using Eclipse: http://www.cmake.org/Wiki/Eclipse_CDT4_Generator http://www.cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial#The_Options
来源:https://stackoverflow.com/questions/3401950/configuring-a-cmake-c-java-project-to-work-with-eclipse