Guidelines and HOWTOs/Build from source/Details

Jump to: navigation, search


CMake from Git

You need a recent version of CMake for KDE Frameworks 5. However, newer versions cause issues with kcoreaddons, namely that not all the headers are installed. Kitware hosts a nightly binary snapshot if you want to skip building it (scroll to the bottom to get the latest). Alternatively you can build it straight from their git:

  • Choose an installation prefix, for instance
 $ export KF5=$HOME/kf5

To avoid repeating the command you can append the above line to the ~/.bashrc file and then run this command from the currently running shells:

 $ source ~/.bashrc  
  • Checkout and install CMake using Git.
 $ git clone git://cmake.org/cmake.git
 $ cd cmake
 $ git checkout v3.0.0
 $ ./configure --prefix=$KF5
 $ make
 $ make install

Extra CMake Modules

  • Checkout and build extra-cmake-modules
 $ git clone git://anongit.kde.org/extra-cmake-modules
 $ cd extra-cmake-modules
 $ cmake -DCMAKE_INSTALL_PREFIX=$KF5 . 
 $ make 
 $ make install

Qt5-based dependencies

To build phonon by hand execute:

 $ git clone kde:phonon --branch master 
 $ mkdir phonon/build
 $ cd phonon/build
 $ cmake -DCMAKE_INSTALL_PREFIX=$KF5 -DCMAKE_PREFIX_PATH=$KF5 -DPHONON_BUILD_PHONON4QT5=ON ..
 $ make
 $ make install

Then build attica (branch master), and strigi (branch master, with submodules) and install them into the same prefix.

To check out and build libdbusmenu-qt execute:

 $ bzr branch lp:libdbusmenu-qt
 $ cd libdbusmenu-qt
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX=$KF5 -DCMAKE_PREFIX_PATH=$KF5 -DWITH_DOC:bool=OFF ..
 $ make
 $ make install


To build polkit-qt-1

 $ git clone git://anongit.kde.org/polkit-qt-1.git
 $ mkdir polkit-qt-1/build
 $ cd polkit-qt-1/build
 $ cmake -DCMAKE_INSTALL_PREFIX=$KF5 -DCMAKE_PREFIX_PATH=$KF5 ..
 $ make
 $ make install

Build KDE frameworks

Current state of the KDE frameworks exist in multiple repositories, and needs an updated Qt5 and extra-cmake-modules . Some Frameworks are dependant on eachother, so they must be built in the following order as shown below.


kitemmodels

  • To build the framework:
 $ git clone git://anongit.kde.org/kitemmodels.git
 $ cd kitemmodels
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kitemviews

  • To build the framework:
 $ git clone git://anongit.kde.org/kitemviews.git
 $ cd kitemviews
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kplotting

  • To build the framework:
 $ git clone git://anongit.kde.org/kplotting.git
 $ cd kplotting
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

threadweaver

  • To build the framework:
 $ git clone git://anongit.kde.org/threadweaver.git
 $ cd threadweaver
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kcodecs

  • To build the framework:
 $ git clone git://anongit.kde.org/kcodecs.git
 $ cd kcodecs
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kguiaddons

  • To build the framework:
 $ git clone git://anongit.kde.org/kguiaddons.git
 $ cd kguiaddons
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kidletime

  • To build the framework:
 $ git clone git://anongit.kde.org/kidletime.git
 $ cd kidletime
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kwidgetsaddons

  • To build the framework:
 $ git clone git://anongit.kde.org/kwidgetsaddons.git
 $ cd kwidgetsaddons
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

sonnet

  • To build the framework:
 $ git clone git://anongit.kde.org/sonnet.git
 $ cd sonnet
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kconfig

  • To build the framework:
 $ git clone git://anongit.kde.org/kconfig.git
 $ cd kconfig
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kwindowsystem

  • To build the framework:
 $ git clone git://anongit.kde.org/kwindowsystem.git
 $ cd kwindowsystem
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

solid

  • To build the framework:
 $ git clone git://anongit.kde.org/solid.git
 $ cd solid
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kglobalaccel

  • To build the framework:
 $ git clone git://anongit.kde.org/kglobalaccel.git
 $ cd kglobalaccel
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

karchive

  • To build the framework:
 $ git clone git://anongit.kde.org/karchive.git
 $ cd karchive
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdbusaddons

  • To build the framework:
 $ git clone git://anongit.kde.org/kdbusaddons.git
 $ cd kdbusaddons
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kcoreaddons

  • To build the framework:
 $ git clone git://anongit.kde.org/kcoreaddons.git
 $ cd kcoreaddons
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kjs

  • To build the framework:
 $ git clone git://anongit.kde.org/kjs.git
 $ cd kjs
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kimageformats

  • To build the framework:
 $ git clone git://anongit.kde.org/kimageformats.git
 $ cd kimageformats
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kauth

  • To build the framework:
 $ git clone git://anongit.kde.org/kauth.git
 $ cd kauth
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kcrash

  • To build the framework:
 $ git clone git://anongit.kde.org/kcrash.git
 $ cd kcrash
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kjobwidgets

  • To build the framework:
 $ git clone git://anongit.kde.org/kjobwidgets.git
 $ cd kjobwidgets
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kcompletion

  • To build the framework:
 $ git clone git://anongit.kde.org/kcompletion.git
 $ cd kcompletion
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

ki18n

  • To build the framework:
 $ git clone git://anongit.kde.org/ki18n.git
 $ cd ki18n
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdoctools

  • To build the framework:
 $ git clone git://anongit.kde.org/kdoctools.git
 $ cd kdoctools
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdnssd

  • To build the framework:
 $ git clone git://anongit.kde.org/kdnssd.git
 $ cd kdnssd
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../..

kconfigwidgets

  • To build the framework:
 $ git clone git://anongit.kde.org/kconfigwidgets.git
 $ cd kconfigwidgets
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kservice

  • To build the framework:
 $ git clone git://anongit.kde.org/kservice.git
 $ cd kservice
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kiconthemes

  • To build the framework:
 $ git clone git://anongit.kde.org/kiconthemes.git
 $ cd kiconthemes
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

knotifications

  • To build the framework:
 $ git clone git://anongit.kde.org/knotifications.git
 $ cd knotifications
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kwallet

  • To build the framework:
 $ git clone git://anongit.kde.org/kwallet.git
 $ cd kwallet
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../..

kpty

  • To build the framework:
 $ git clone git://anongit.kde.org/kpty.git
 $ cd kpty
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kemoticons

  • To build the framework:
 $ git clone git://anongit.kde.org/kemoticons.git
 $ cd kemoticons
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdesu

  • To build the framework:
 $ git clone git://anongit.kde.org/kdesu.git
 $ cd kdesu
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

ktextwidgets

  • To build the framework:
 $ git clone git://anongit.kde.org/ktextwidgets.git
 $ cd ktextwidgets
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kxmlgui

  • To build the framework:
 $ git clone git://anongit.kde.org/kxmlgui.git
 $ cd kxmlgui
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kbookmarks

  • To build the framework:
 $ git clone git://anongit.kde.org/kbookmarks.git
 $ cd kbookmarks
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kio

  • To build the framework:
 $ git clone git://anongit.kde.org/kio.git
 $ cd kio
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdesignerplugin

  • To build the framework:
 $ git clone git://anongit.kde.org/kdesignerplugin.git
 $ cd kdesignerplugin
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

knewstuff

  • To build the framework:
 $ git clone git://anongit.kde.org/knewstuff.git
 $ cd knewstuff
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kparts

  • To build the framework:
 $ git clone git://anongit.kde.org/kparts.git
 $ cd kparts
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kpackage

  • To build the framework:
 $ git clone git://anongit.kde.org/kpackage.git
 $ cd kpackage
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdeclarative

  • To build the framework:
 $ git clone git://anongit.kde.org/kdeclarative.git
 $ cd kdeclarative
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kcmutils

  • To build the framework:
 $ git clone git://anongit.kde.org/kcmutils.git
 $ cd kcmutils
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kinit

  • To build the framework:
 $ git clone git://anongit.kde.org/kinit.git
 $ cd kinit
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kded

  • To build the framework:
 $ git clone git://anongit.kde.org/kded.git
 $ cd kded
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

knotifyconfig

  • To build the framework:
 $ git clone git://anongit.kde.org/knotifyconfig.git
 $ cd knotifyconfig
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kunitconversion

  • To build the framework:
 $ git clone git://anongit.kde.org/kunitconversion.git
 $ cd kunitconversion
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kjsembed

  • To build the framework:
 $ git clone git://anongit.kde.org/kjsembed.git
 $ cd kjsembed
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kross

  • To build the framework:
 $ git clone git://anongit.kde.org/kross.git
 $ cd kross
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kmediaplayer

  • To build the framework:
 $ git clone git://anongit.kde.org/kmediaplayer.git
 $ cd kmediaplayer
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdewebkit

  • To build the framework:
 $ git clone git://anongit.kde.org/kdewebkit.git
 $ cd kdewebkit
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

ktexteditor

  • To build the framework:
 $ git clone git://anongit.kde.org/ktexteditor.git
 $ cd ktexteditor
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kapidox

  • To build the framework:
 $ git clone git://anongit.kde.org/kapidox.git
 $ cd kapidox
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

frameworkintegration

  • To build the framework:
 $ git clone git://anongit.kde.org/frameworkintegration.git
 $ cd frameworkintegration
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 

kdelibs4support

  • To build the framework:
 $ git clone git://anongit.kde.org/kdelibs4support.git
 $ cd kdelibs4support
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../..


khtml

  • To build the framework:
 $ git clone git://anongit.kde.org/khtml.git
 $ cd khtml
 $ mkdir build
 $ cd build
 $ cmake -DCMAKE_INSTALL_PREFIX= -DCMAKE_PREFIX_PATH= ..
 $ make
 $ make install
 $ cd ../.. 


Debugging options: The default debug setting is RelWithDebInfo which is suitable for most developers. If you are debugging frameworks and cannot trace the code, you can set CMAKE_BUILD_TYPE to "DebugFull" to get a slower build but with even more verbose debugging (backtrace) information. For this replace -DCMAKE_BUILD_TYPE=RelWithDebInfo in the above cmake command with -DCMAKE_BUILD_TYPE=DebugFull.

Updating the already built framework: If the source code has been checked from a branch, it is possible to update the source code with newly added changes and build again. Usually only changing parts will be built, so this operation would be faster than building the source code from scratch.

Go to your source directory and execute following commands.

 $ git pull --rebase
 $ cd build
 $ source <source-filename>
 $ make
 $ make install

Plasma

kactivities

Plasma libraries depends upon the kactivities framework.

$ git clone git://anongit.kde.org/kactivities
$ mkdir kactivities/build
$ cd kactivities/build
$ source <source-filename>
$ cmake -DCMAKE_INSTALL_PREFIX=$KF5 -DCMAKE_PREFIX_PATH=$KF5 ..
$ make
$ make install

plasma-framework

The Plasma libraries and runtime components have moved into a new repository: plasma-framework. To get libplasma and the QML support for Plasma, after building kdelibs as shown above, execute the following commands:

 $ git clone kde:plasma-framework
 $ mkdir  plasma-framework/build 
 $ cd plasma-framework/build 
 $ source <source-filename>
 $ cmake -DCMAKE_INSTALL_PREFIX=$KF5 -DCMAKE_PREFIX_PATH=$KF5 ..
 $ make
 $ make install

kde-workspace & Friends

Plasma-based components such as the code in the kde-workspace repo is being ported inside those repositories in the frameworks-scratch branch. This works for the kde-workspace, kdeplasma-addons, plasmate and kdeexamples repositories. You can install whatever is already ported and enabled using the following commands:

 $ git clone kde:kde-workspace
 $ mkdir  kde-workspace/build 
 $ cd kde-workspace/build 
 $ git checkout frameworks
 $ source <source-filename>
 $ cmake -DCMAKE_INSTALL_PREFIX=$KF5 -DCMAKE_PREFIX_PATH=$KF5 ..
 $ make
 $ make install

If you want to build one of the other repositories, just replace kde-workspace with e.g. kdeplasma-addons.


This page was last modified on 16 November 2016, at 09:50. Content is available under Creative Commons License SA 4.0 unless otherwise noted.