views:

1816

answers:

2

I want to use Eclipse to develop C++ projects on Linux. Particularly I want to modify stable and widely used open source projects using the Eclipse CDT. One of them is Intel Opencv. There are tutorials to create simple c++ projects like here:

I have seen plenty of tutorials for using Eclipse CDT to write programs in OpenCv like here:

However I want to use Eclipse to make changes to the OpenCv platform itself and compile it from there. I really like many of Eclipse's features like:

  • Syntax highlighting
  • Outline
  • Code assist
  • Code templates
  • Code history
  • etc.

Would someone write a small tutorial on how one can make a project in Eclipse from the OpenCv tarball? I would use Eclipse CDT on Linux.

Can Eclipse CDT recognize Makefile as it can do for Ant scripts?

+1  A: 

I made the experience that for OpenCV using cmake is the way to go. You can unzip the cmake source code and use cmake to compile it. Even after your changes. There are some tools to integrate cmake into eclipse but I found them unstable or not very mature so I use cmake from a terminal to compile and eclipse for editing the source files.

Janusz
Thanks Janusz . which version of Opencv did you try with Cmake ? the latest one here : https://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/trunk/opencv/ has a CMakeLists.txt in it. I'm using OpenCv-1.0.0 which uses just autotools. Using the Cmake tools with the latest OpenCv is also mentioned here : http://opencv.willowgarage.com/wiki/InstallGuide .Is it possible to just use autotools to generate the Eclipse project files ?
iceman
I'm using the last version of OpenCV from the SVN hoping that some bugs for mac os x are fixed in this version.
Janusz
i downloaded the latest opencv and i used the command cmake -G "Eclipse CDT4 - Unix Makefiles" /path/to/opencvsrc , it did not produce the Eclipse project files.
iceman
I'm not generating eclipse files with OpenCV I have a c++ project in Eclipse but for all the compiling I use a command line with cmake and make. It is not that integrated in Eclipse as you would wish for but for me it is enough
Janusz
I would agree to this...Eclipse would still take some time to get to that level of maturity as Visual Studio and specially on Linux, its probably more so...
iceman
+1  A: 

If you follow Janusz's advice about using cmake you can find here a good tutorial about using cmake and its eclipse projects generator (I actually followed it no long time ago :-) ). In this link you will find more information about that generator (Eclipse CDT4 Generator)

fco.javier.sanz
I'm using Eclipse CDT 5.0.x . is this for CDT 4?
iceman
I download the latest opencv from svn which has a CMakeLists.txt in it. I'm using Eclipse 3.4 with CDT 5.0.x. now when i used the command cmake -G "Eclipse CDT4 - Unix Makefiles" /path/to/opencvsrc , it did not produce the Eclipse project files. However when I tried , cmake -G "KDevelop3" /path/to/opencvsrc , it could produce the Kdevelop project files... whats going wrong ?
iceman