Five minute guide to setup Eclipse for KDE development

Categories: KDE
Tags: No Tags
Comments: 4 Comments
Published on: July 22, 2008

Someone asked how to setup Eclipse for KDE development in my last copy/paste bug rant. Here’s how I did, in short.

  1. Setup a working KDE development system according to Techbase, with cmakekde and all the good stuff.
  2. Download Eclipse 3.4 Ganymede, preferably the C++ one from eclipse.org, but any set containing CDT will do.
  3. Create /home/kde-devel/cmakekdeeclipse similarly to cmakekde (see the end for the content), make it executable (chmod +x)
  4. In Eclipse, File => New => Other => SVN => Checkout Projects from SVN. Checkout the KDE module you want to have in Eclipse. Use the C++ wizard when creating the project, set it to a Makefile project. You’ll adjust that later (or use the Advanced Settings button directly).
  5. After the checkout, open the projects properties and choose the C++ Builder tab. Change the builder from make to /home/kde-devel/cmakekdeeclipse ${workspace_loc:/playground_plasma} and choose an existing, empty directory for the build directory.
    Change playground_plasma to the name of your project.
  6. Press Ok. If all went well, you can just hit the “Build” button now and it will just work ™.
  7. Realize it took more than five minutes ;-)

Things to enjoy: Error and warning parser that will annotate faulty lines, a great indexer and content assistant, spell checking (that’s actually useful), gdb integration, doxygen assistant, Bugzilla integration (sadly not working with KDE Bugzilla), IRC integration (needs communication framework), Subversion support (needs subclipse/subversive), code formatting and a whole lot more.

Last not least some random tweaks:

  • Set the environment option LC_ALL to C in the preferences if the error/warning parser shows warnings as errors
  • Disable klippers setting “Prevent empty clipboard” if copy/paste in Eclipse behaves weird
  • Activate doxygen support in Window => Preferences => C/C++ => Editor
  • Disable automatic builds
  • Activate the (gnu) elf parser for gdb integration in Project Settings => C/C++ Build => Settings => Binary Parsers

And finally the cmakekdeeclipse script I use to invoke building:

#!/bin/bash
set -e

srcFolder=”${1}”
test -d “${srcFolder}”
source ~/.bashrc
cmake $srcFolder -DCMAKE_INSTALL_PREFIX=$KDEDIR -DCMAKE_BUILD_TYPE=debugfull
nice make -j3 VERBOSE=1
make install

No pic, no care?

4 Comments
  1. Alex Neundorf says:

    This is nice, but there is no need to resort to such scripts (which calls cmake everytime ? and hardcoded -j3 ?)

    If you are using CMake >= 2.6.0, you can let cmake generate the Eclipse project for you:
    http://www.cmake.org/Wiki/Eclipse_CDT4_Generator

    Or you just start “cmake-gui” (instead of cmake) and figure out the rest :-)

    One note: Eclipse has problems with out-of-source builds, this is ugly.

    Alex

  2. ahmed (Bassio) says:

    Thank you very much Dennis. :)

  3. ahmed (Bassio) says:

    Hey Dennis ..

    if you don’t mind .. can you post a 5-minute guide to ”Debugging” kde apps in eclipse

    This will be great and a very kind gesture. :)

  4. […] Nienhüser explains how you can use eclipse to develop kde applications. Things to enjoy: Error and warning parser that will annotate faulty lines, a great indexer and […]

Comments are closed.

Welcome , today is Saturday, December 20, 2014