To use kdesrc-build, you should have a file in your home directory called
.kdesrc-buildrc, which sets the general options and sets the modules
you would like to download and build.
It is possible to use different configuration files for kdesrc-build,
which is described in Chapter 4, Configuring kdesrc-build. If you need to use
multiple configurations, please see that section. Here, we will assume the
configuration is stored in
The easiest way to proceed is to use the
kdesrc-buildrc-kf5-sample file as a template, changing global
options to match your wants, and also change the list of modules you want to
The default settings should be appropriate to perform a KDE build. Some settings that you may wish to alter include:
kdedir, which changes the destination directory that your KDE software is installed to. This defaults to
~/kde, which is a single-user installation.
branch-group, which can be used to choose the appropriate branch of development for the KDE modules as a whole. There are many supported build configurations but you will likely want to choose
kf5-qt5so that kdesrc-build downloads the latest code based on Qt™ 5 and KDE Frameworks 5.
kdesrc-build will use a default branch group if you do not choose one, but this default will change over time, so it's better to choose one so that the branch group does not change unexpectedly.
source-dir, to control the directory kdesrc-build uses for downloading the source code, running the build process, and saving logs. This defaults to
cmake-options, which sets the options to pass to the CMake command when building each module. Typically this is used to set between “debug” or “release” builds, to enable (or disable) optional features, or to pass information to the build process about the location of required libraries.
make-options, which sets the options used when actually running the make command to build each module (once CMake has established the build system).
The most typical option is
Nshould be replaced with the maximum number of compile jobs you wish to allow. A higher number (up to the number of logical CPUs your system has available) leads to quicker builds, but requires more system resources.
Example 2.1. Configuring Make for 4 compiles at once, with exceptions
global make-options -j4 … end global … module-set
big-module-setrepository kde-projects use-modules
calligramake-options -j2 # Reduced number of build jobs for just these modules end module-set
Some very large Git repositories may swamp your system if you try to compile with a too many build jobs at one time, especially repositories like the Qt™ WebKit and Qt™ WebEngine repositories. To maintain system interactivity you may have to reduce the number of build jobs for specific modules.
Example 2.1, “Configuring Make for 4 compiles at once, with exceptions” gives an example of how to do this.
You may want to select different modules to build, which is described in the section called “Selecting modules to build”.