How to Generate Eclipse Project Files with Cmake

Cmake has the ability to generate Eclipse project files. If you will be using the Eclipse IDE for editing and building OSSIM, it is recommended you do the following.

If you haven't already, read the build instructions in OSSIM Build Instructions V 1.4.

Copy the build script from $OSSIM_DEV_HOME/ossim_package_support/cmake/build_scripts/unix/ to the top-level $OSSIM_DEV_HOME dir. Open the script in an editor and review that everything is kosher. There may need to be some tweaking to locate 3rd party libs that aren't part of the standard linux install (e.g., kakadu and mrsid).

Run the script from $OSSIM_DEV_HOME. You should see it create and populate the "out-of-source" build directory in ../build.

Open Eclipse IDE and define a new workspace that will contain the ossim project. Do File->Import->General->"Existing Projects into Workspace". In the Import dialog, select root directory by browsing to your build directory ($OSSIM_DEV_HOME/../build). Also make sure that the option, "Search for nested projects" is checked, and click "Finish".

In the Project Explorer, you should see a project named something like ossim-Debug@build or ossim-Release@build depending on which build type you had chosen in the build script. Under that, there should be a [Source directory] folder. This is a link to $OSSIM_DEV_HOME where you'll find all the source code for editing. The other folders are all in the build dir and can be ignored. It ain't pretty but you'll get used to it (resistance is futile).

You can right-click on the top-level project now and select "Build Project". You may want to inspect the contents of the "Includes" folder (in the Project Explorer) to make sure you are seeing all the system and ossim-specific include paths (including those implied by $OSSIM_DEPENDENCIES.

The targets will be in build/lib and build/bin. Now you can set up debug configurations in the IDE and debug your code (or most likely somebody else's). Good luck!

Last modified 5 years ago Last modified on Sep 23, 2014 6:23:09 AM