Getting Started/Build/KDE Applications

< Getting Started‎ | Build
Revision as of 23:25, 8 November 2011 by Icwiener (Talk | contribs)

Jump to: navigation, search


The process to build applications is easy. It can get tedious in the beginning but with time it's easy to understand.

In this page I'll discuss the compilation and installation of a simple KDE application or project on a regular GNU/Linux system. It can get more complicated but I'd prefer to keep this document simple.

Preparing your system a little

First of all you probably will need to know the dependencies to compile the program you want to compile. In my experience, a great portion of the problems that people have forgot to install the development packages for the system libraries. Keep that in mind.

In general, the needed packages will be: cmake, git-core, libqt4(-dev), kdelibs(-dev). Depends on the distribution but the naming should be something like this.


Here we will try to compile an application, let's say blinken. You can find a full compendium of the KDE projects in

First we will download the code

git clone git://

This will create a directory with blinken's source code inside. We get in and we create a directory where it's going to be built

cd blinken; mkdir build; cd build

Now we'll set up the development system by calling cmake. We're passing two parameters here CMAKE_INSTALL_PREFIX that will tell where the application will be installed and CMAKE_BUILD_TYPE that will tell the optimization of the produced binaries. (not entirely accurate, but there's heaps of documentation about that).

cmake .. -DCMAKE_INSTALL_PREFIX=<install_path> -DCMAKE_BUILD_TYPE=debugfull

The moment we were all expecting has arrived, now you can start compiling.


Some applications can work without installing but that's usually not the case so just do it if you know what you're doing, otherwise you will want to install probably.

make install

If you're installing it to a directory where the owner is root, then you'll probably need some extended privileges to install. That's not the only option, though. You can create a specific install directory by pointing the PATH and KDEDIRS variables to it, more information here: Getting_Started/Build/Environment

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal