First, we go back to the <tt>kde-devel</tt> user's source directory (line 1), get the CMake sources (line 2) and unpack them (line 3). We create a directory to build CMake in (line 4) and go into it (line 5). We then run the CMake bootstrap script to set up the CMake build (line 6), then make (line 7) and install it (line 8) using the root user.

Next we need to get the Qt4 that is in KDE's source repository. KDE is guaranteed to build against any Qt 4.3. Qt 4.2 and earlier are not supported and will not work. You should use the copy in the KDE Subversion servers. (note: some distros, like Debian or openSUSE, tend to supply Qt with patches from KDE svn applied, so you may want to cheat and use precompiled Qt from your distro, because they will work just as well). KDE tries to guarantee that the source is compileable with a plain, unpatched Qt 4.3.0, but you might get additional bugfixes by using qt-copy (however, usually your distribution takes care of backporting necessary bugfixes so overall you're most likely better off with sticking to the distro provided one if it is recent enough). Refer to the distribution specific sections above for more information.

We switch back to the <tt>kde-devel</tt> user's home directory (line 1) and download the source code using subversion (svn) from KDE's repository (line 2). After changing into the resulting {{path|qt-copy}} directory (line 3), we run a script that manages the patches that come with <tt>qt-copy</tt> (line 4).

Once the patches have been applied, we then set up the build using the <tt>configure</tt> script (line 5-6). The various command line options used are explained in the {{path|qt-copy/README.qt-copy}} file. Finally, we build the minimal requirements for KDE (line 7) and install (line 10) Qt. If install dir is the same as the current dir (line 8), then we just free some space (line 9) instead. If you want all the example and demo applications, you can either build them individually or simply do a <tt>make</tt> from the {{path|qt-copy}} directory.

Note that the installation does not require root as it installs Qt locally into {{path|$QTDIR}}. Anyway, installation is only needed if {{path|$QTDIR}} differs from {{path|$HOME/qt-copy}}, which is not the case if you have exactly followed the instructions.

If you get "error: X11/Xlib.h: No such file or directory", install the devel package of <tt>xorg</tt> (the actual name may vary between operating systems, for example it is <tt>xorg-dev</tt> on Ubuntu based systems such as Kubuntu).

If you get an error in the configure step about missing defines, check the value of <tt>$QMAKESPEC</tt>. Some distributions set this to point directly to the system-installed Qt. If <tt>unset QMAKESPEC</tt> solves the problem, you probably want to add it to the <tt>~/.bashrc</tt> script.

If you get an error ".pch/debug-shared/QtCore", this is because Qt-4.3 enables precompiled headers if your gcc supports it, but for some reason it doesn't work for you. If you use distcc, configure qt with -no-pch. If you use icecream, update to the latest icecream from svn trunk.

Try running any Qt program, like {{program|assistant}}. '''Note:''' You may need to run <tt>xhost +local:kde-devel</tt> as your regular kde3 user to run this application. If it crashes in QSpanData::adjustSpanMethods, then your problem is the oxygen style. Try removing {{path|lib/kde4/plugins/styles/kstyle-oxygen.so}} and {{path|lib/kde4/plugins/styles/oxygen.so}} if they exist in the KDE install prefix.

{{tip|You can use qdbusviewer to see if you have org.freedesktop.hal. If not, you might need a newer version of hal. If you have org.freedesktop.hal, you probably don't need to, and don't ''want'' to, roll your own HAL.}}

If your system requires you to build a newer version of HAL, there's a decent chance you'll need to build other stuff as well, some of which may not be straight forward. Since this should only be required for older distros, instructions are on [[Getting_Started/Build/HAL| a separate page]].

{{warning|Don't forget to read the [[Getting_Started/Build/KDE4#Setting_up_the_environment|Setting Up The Environment]] section first.}}

+

{{warning (pt_BR)|Don't forget to read the [[Getting_Started/Build/KDE4#Setting_up_the_environment|Setting Up The Environment]] section first.}}

There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs.

There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs.

Line 487:

Line 488:

Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section.

Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section.

We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new {{path|~/kde/src/kdesupport}} directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed.

We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new {{path|~/kde/src/kdesupport}} directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed.

We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new {{path|~/kde/src/KDE/kdelibs}} directory (line 4), and commence the build (line 5). This will leave us in the <tt>kdelibs</tt> build directory after the build is completed.

We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new {{path|~/kde/src/KDE/kdelibs}} directory (line 4), and commence the build (line 5). This will leave us in the <tt>kdelibs</tt> build directory after the build is completed.

−

{{tip|There might be missing dependencies on your system! They are easily overlooked in the output of <tt>cmakekde</tt>.

+

{{tip (pt_BR)|There might be missing dependencies on your system! They are easily overlooked in the output of <tt>cmakekde</tt>.

You might want to do a <tt>cmake $KDE_SRC/KDE/MODULE_NAME</tt> prior to compiling any kde modules (like kdelibs, kdepimlibs etc.)}}

You might want to do a <tt>cmake $KDE_SRC/KDE/MODULE_NAME</tt> prior to compiling any kde modules (like kdelibs, kdepimlibs etc.)}}

Line 554:

Line 555:

There are additional CMake modules in {{path|kdelibs/cmake/modules/}} that are necessary for building KDE4 applications. These will be installed for you when kdelibs itself is installed.

There are additional CMake modules in {{path|kdelibs/cmake/modules/}} that are necessary for building KDE4 applications. These will be installed for you when kdelibs itself is installed.

−

=== Troubleshooting ===

+

=== Solução de problemas ===

If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/KDE4#Required_Software|Required Software]] section above is installed and works. Other possible hints include:

If you have problems compiling kdelibs, first make sure the software in the [[Getting_Started/Build/KDE4#Required_Software|Required Software]] section above is installed and works. Other possible hints include:

* If the <tt>cmakekde</tt> command fails stating that CMake requires an out of source build directory, remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}}, and try again.

* If the <tt>cmakekde</tt> command fails stating that CMake requires an out of source build directory, remove {{path|~/kde/src/KDE/kdelibs/CMakeCache.txt}}, and try again.

Line 573:

Line 574:

* Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>".

* Here you need the libungif library, otherwise you will get an error message like "<tt>Could NOT find GIF</tt>".

* Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run).

* Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run).

−

* if you get <code>CMake Error: KDE Requires Qt to be built with SSL support

+

* if you get <syntaxhighlight lang="text">CMake Error: KDE Requires Qt to be built with SSL support

* if you get <code>kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'</code> it means you compiled QT without QT3 support(no, linking to a true QT3 install won't work)

+

* if you get <syntaxhighlight lang="text">kdelibs/kimgio/ico.cpp:188: undefined reference to `QImage::jumpTable()'</syntaxhighlight> it means you compiled QT without QT3 support(no, linking to a true QT3 install won't work)

== kdepimlibs ==

== kdepimlibs ==

After <tt>kdelibs</tt>, but before ''kdebase'', you need to build and install ''kdepimlibs''.

After <tt>kdelibs</tt>, but before ''kdebase'', you need to build and install ''kdepimlibs''.

We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new {{path|~/kde/src/KDE/kdepimlibs}} directory (line 3). We then commence the build (line 4). This will leave us in the <tt>kdepimlibs</tt> build directory after the build is completed.

We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new {{path|~/kde/src/KDE/kdepimlibs}} directory (line 3). We then commence the build (line 4). This will leave us in the <tt>kdepimlibs</tt> build directory after the build is completed.

−

=== Troubleshooting ===

+

=== Solução de problemas ===

−

If you have trouble compiling kdepimlibs:

+

Se você tem problemas compilando kdepimlibs:

* the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/(en)/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install.

* the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/(en)/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install.

== kdebase ==

== kdebase ==

−

kdebase is divided into three parts:

+

kdebase é dividido em três partes:

* '''apps'''

* '''apps'''

:This contains applications like Dolphin or KWrite.

:This contains applications like Dolphin or KWrite.

Line 603:

Line 604:

:This contains things specific to the KDE desktop, like Plasma or the window manager. Most stuff here depends on X11. You only need it if you want to build a full KDE desktop.

:This contains things specific to the KDE desktop, like Plasma or the window manager. Most stuff here depends on X11. You only need it if you want to build a full KDE desktop.

−

You can build all of kdebase at once, which is described in the recipe below. If you only want to build kdebase-runtime, which is the only requirement, you can replace <code bash>cd kdebase</code> with <code bash>cd kdebase/runtime</code> in the recipe below.

+

You can build all of kdebase at once, which is described in the recipe below. If you only want to build kdebase-runtime, which is the only requirement, you can replace <syntaxhighlight lang="bash">cd kdebase</syntaxhighlight> with <syntaxhighlight lang="bash">cd kdebase/runtime</syntaxhighlight> in the recipe below.

* if cmakekde can not find the path of kdepimlibs, edit the file {{path|$KDE_BUILD/KDE/kdebase/CMakeCache.txt}} and manually set <tt>KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs</tt>

* if cmakekde can not find the path of kdepimlibs, edit the file {{path|$KDE_BUILD/KDE/kdebase/CMakeCache.txt}} and manually set <tt>KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs</tt>

* if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of <tt>Xtst</tt>. On some systems, this is packaged separately from <tt>xext</tt> and called <tt>x11proto-xext-dev</tt> or <tt>libxtst-dev</tt>. You may also need to remove the CMakeCache.txt file in the build dir after installing the package.

* if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of <tt>Xtst</tt>. On some systems, this is packaged separately from <tt>xext</tt> and called <tt>x11proto-xext-dev</tt> or <tt>libxtst-dev</tt>. You may also need to remove the CMakeCache.txt file in the build dir after installing the package.

Line 629:

Line 630:

* If you get the message "kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared", you might need to install libxklavier development packages.

* If you get the message "kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared", you might need to install libxklavier development packages.

−

== Running KDE 4 programs ==

+

== Executando programas KDE 4 ==

−

You can now run KDE 4 programs (e.g. kwrite) by typing:

+

Você pode agora executar programas KDE 5 (exemplo, kwrite) digitando:

ssh -X kde-devel@localhost

ssh -X kde-devel@localhost

kwrite

kwrite

−

=== Troubleshooting ===

+

=== Solução de problemas ===

−

* If you get

+

* Se você obter

KUniqueApplication: Cannot find the D-Bus session server

KUniqueApplication: Cannot find the D-Bus session server

check if you can access the display, e.g. type

check if you can access the display, e.g. type

Line 643:

Line 644:

and see if a clock appears on the screen.

and see if a clock appears on the screen.

−

* If you get something like

+

* Se você obter algo como

Error: standard icon theme "oxygen" not found!

Error: standard icon theme "oxygen" not found!

Line 650:

Line 651:

You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase.

You need to install kdebase - see above. It is enough to install the "runtime" directory from kdebase.

−

== Generating local API documentation ==

+

== Gerando a documentação API local ==

Although the API documentation for KDE is available online at [http://api.kde.org api.kde.org], it is sometimes useful to have it on your own disk, for example when you want to use [[Getting_Started/Set_up_KDE_4_for_development#KDevelop|KDevelop]] for browsing the documentation or when you are not able to be online all the time.

Although the API documentation for KDE is available online at [http://api.kde.org api.kde.org], it is sometimes useful to have it on your own disk, for example when you want to use [[Getting_Started/Set_up_KDE_4_for_development#KDevelop|KDevelop]] for browsing the documentation or when you are not able to be online all the time.

Line 668:

Line 669:

Another, even easier method involves downloading this [[Doxyfile]] to your local system. Then simply change directory to where you want to create the documentation and run

Another, even easier method involves downloading this [[Doxyfile]] to your local system. Then simply change directory to where you want to create the documentation and run

−

<code bash>

+

<syntaxhighlight lang="bash">

% doxygen /path/to/Doxyfile

% doxygen /path/to/Doxyfile

−

</code>

+

</syntaxhighlight>

Then review the file {{path|doxygen.log}} to see the doxygen errors and warnings. You'll find the actual documentation in the {{path|apidocs}} subdirectory.

Then review the file {{path|doxygen.log}} to see the doxygen errors and warnings. You'll find the actual documentation in the {{path|apidocs}} subdirectory.

−

== Staying up to date ==

+

== Mantendo-se atualizado ==

In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run <tt>svn up</tt> and <tt>make</tt>.

In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run <tt>svn up</tt> and <tt>make</tt>.

For example:

For example:

−

<code bash>

+

<syntaxhighlight lang="bash">

cs kdesupport # cs is not a typo

cs kdesupport # cs is not a typo

svn up

svn up

cb # cb is not a typo

cb # cb is not a typo

make -j2 VERBOSE=1 && make install

make -j2 VERBOSE=1 && make install

−

</code>

+

</syntaxhighlight>

−

== Installing a subset of a module ==

+

== Instalando um subconjunto de um módulo ==

Many modules in KDE contain a large number of programs which could take a long time to download and compile. In cases where you want to work only on a particular program or programs in a module, it is possible to download and compile particular folders. In some cases, certain folders are required for any build of the module. This is determined in the CMakeLists.txt file of the module. For example the [http://websvn.kde.org/trunk/KDE/kdegames/CMakeLists.txt?view=markup kdegames CMakeLists.txt file] lists:

Many modules in KDE contain a large number of programs which could take a long time to download and compile. In cases where you want to work only on a particular program or programs in a module, it is possible to download and compile particular folders. In some cases, certain folders are required for any build of the module. This is determined in the CMakeLists.txt file of the module. For example the [http://websvn.kde.org/trunk/KDE/kdegames/CMakeLists.txt?view=markup kdegames CMakeLists.txt file] lists:

−

<code>

+

<syntaxhighlight lang="text">

add_subdirectory(libkdegames)

add_subdirectory(libkdegames)

add_subdirectory(libkmahjongg)

add_subdirectory(libkmahjongg)

Line 696:

Line 697:

macro_optional_add_subdirectory(lskat)

macro_optional_add_subdirectory(lskat)

macro_optional_add_subdirectory(katomic)

macro_optional_add_subdirectory(katomic)

−

</code>

+

</syntaxhighlight>

So, the libkdegames and libkmahjongg directories are required to build any of kdegames. The cmake directory will also usually be required. All the other directories (doc, katomic etc) are optional. They will be built if present on your machine. In this example, we build kmahjongg and kbattleship:

So, the libkdegames and libkmahjongg directories are required to build any of kdegames. The cmake directory will also usually be required. All the other directories (doc, katomic etc) are optional. They will be built if present on your machine. In this example, we build kmahjongg and kbattleship:

−

<code bash>

+

<syntaxhighlight lang="bash">

cs KDE

cs KDE

svn co -N kdegames # The -N switch performs a non-recursive checkout

svn co -N kdegames # The -N switch performs a non-recursive checkout

Line 710:

Line 711:

svn up kmahjongg

svn up kmahjongg

cmakekde

cmakekde

−

</code>

+

</syntaxhighlight>

−

== General troubleshooting ==

+

== Solução de problemas gerais ==

What can happen over time, after some <tt>svn up</tt> commands, is that some of the tools used in the KDE build chain change their output format. For example, <tt>kcfg</tt> files are read by <tt>kconfig_compiler</tt> to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files:

What can happen over time, after some <tt>svn up</tt> commands, is that some of the tools used in the KDE build chain change their output format. For example, <tt>kcfg</tt> files are read by <tt>kconfig_compiler</tt> to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files:

Line 718:

Line 719:

The same applies to <tt>ui</tt> files as produced by Qt designer.

The same applies to <tt>ui</tt> files as produced by Qt designer.

−

=== Locked sessions ===

+

=== Sessões bloqueadas ===

When installing KDE 4 as a user, one will not be able to unlock a locked session. To work around this issue you can either:

When installing KDE 4 as a user, one will not be able to unlock a locked session. To work around this issue you can either:

su

su

Line 725:

Line 726:

chmod 755 $KDEDIR/lib/kde4/libexec/kcheckpass

chmod 755 $KDEDIR/lib/kde4/libexec/kcheckpass

−

== Success! ==

+

== Sucesso! ==

You are now ready to start building other svn modules in the same fashion as you built kdebase, running and testing KDE4 or writing your own patches and applications.

You are now ready to start building other svn modules in the same fashion as you built kdebase, running and testing KDE4 or writing your own patches and applications.

There are several libraries that KDE applications rely on in the kdesupport module. This includes Strigi and Soprano for file metadata and search, QImageBlitz for image manipulation needed in kdebase, eigen for visual effects in applications such as Kalzium, taglib for music players and qca for some cryptographic needs.

Strigi itself has a few dependencies as well: you will need the libraries and headers for libz, libbz2, openssl (libcrypto or libssl), libclucene (>=0.9.16a but watch out: version 0.9.17 does not work), and either libxml2 or libexpat.

Please remember that if you use openSUSE, you can install the needed packages from the KDE:KDE4 buildservice repository and do not have to bother with fiddling the details below. Skip to the kdelibs section.

We change to the base source directory (line 1). We download the sources in kdesupport using subversion (line 2), go into the new ~/kde/src/kdesupport directory (line 3), and commence the build (line 4). This will leave us in the kdesupport build directory after the build is completed.

then you have to go manually into the kdesupport directory in ~ and execute the command cmakekde. if this still doesn't work, then something is wrong with your bashrc.

If you get

CMake Error: This project requires some variables to be set,
and cmake can not find them.
Please set the following variables:
LIBXML2_INCLUDE_DIR (ADVANCED)

you should install the development package for libxml2.

If you get

CMake Error: Could NOT find REDLAND

then you need librdf from the Redland.
If your distribution does not provide the librdf package, you can download the source there: http://download.librdf.org/source/ and build it.
(Gentoo users: The ebuild for librdf is named dev-libs/redland)

take a second look in the .bashrc file described above, are paths correct? ($QTDIR and $PATH are used to get the QT installation path)
Alternatively, you may see this error if you decided to use a distribution installed version of qt4 and skipped the Qt install above. Either install qt-copy as describe above, or "sudo make install". If you use "sudo make install", make sure that you change the ownership back to your user for some of the ~/kde subdirectories that were effected by using sudo (ie. "sudo chown -R kde-devel:kde-devel ~/kde").

We change to the base source directory (line 1) then make and go into the KDE directory (line 2). We download the sources for kdelibs using subversion (line 3), go into the new ~/kde/src/KDE/kdelibs directory (line 4), and commence the build (line 5). This will leave us in the kdelibs build directory after the build is completed.

{{{3}}}

There might be missing dependencies on your system! They are easily overlooked in the output of cmakekde.
You might want to do a cmake $KDE_SRC/KDE/MODULE_NAME prior to compiling any kde modules (like kdelibs, kdepimlibs etc.)

If you received an error stating "Please create a separate build directory and run 'cmake path_to_kdelibs [options]' there.", then you need to change to your build directory before running cmakekde. (e.g cs KDE/kdelibs && cb && cmakekde) If the message stays, run 'svn status' in the kdelibs directory and remove all files labeled with '?'.

If Qt wasn't found or the wrong version of Qt was found, make sure that the qmake from the Qt you need is the first qmake in the path.

If qmake wasn't found and you are using Debian packages, /usr/bin/qmake probably points to a wrong qmake version. To fix this run as root:

update-alternatives --config qmake

If the problems persist, try the CMake make-option --keep-going.

Here you need the libungif library, otherwise you will get an error message like "Could NOT find GIF".

Qt-4.3 upgrade: if you get a link error in kjsembed talking about QScriptEngine, edit CMakeCache.txt in kdelibs and remove the lines that talk about QT_QTUITOOLS_LIBRARY, then type make again (that static library has a new dependency, and the cmake code that adds it needs to run).

We go into the KDE source directory (line 1), download the source code for kdepimlibs using subversion (line 2) and then go into the new ~/kde/src/KDE/kdepimlibs directory (line 3). We then commence the build (line 4). This will leave us in the kdepimlibs build directory after the build is completed.

the cmakekde command may require a later version of the gpgme library. This is available from the project's web site: http://www.gnupg.org/(en)/download/index.html - please note that the build of gpgme also requires libgpg-error, also available from the same location. Both libraries are installed by the "./configure", "make" and "sudo make install" sequence, with the gpgme library configured with the additional "--with-gpg-error-prefix" parameter. You may need to overwrite your existing "/usr/bin/gpgme-config" file with the newer version for the kdepimlibs to pick up the new install.

Make sure you have the libxss headers installed. (Usually you got undefined references on xscreensaver objects if you do not have those headers)

which meinproc4 has to deliver /home/kde-devel/kde/bin/meinproc4

if cmakekde can not find the path of kdepimlibs, edit the file $KDE_BUILD/KDE/kdebase/CMakeCache.txt and manually set KDEPIMLIBS_INCLUDE_DIR:PATH=$KDE_BUILD/kdepimlibs

if you get an error saying "Please set the following variables: X11_XTest_LIB (ADVANCED)", install the devel package of Xtst. On some systems, this is packaged separately from xext and called x11proto-xext-dev or libxtst-dev. You may also need to remove the CMakeCache.txt file in the build dir after installing the package.

the same for "X11_Xinerama_LIB (ADVANCED)" where you will need the devel package for xinerama.

if you get an error complaining about a missing variable X11_Xrandr_LIB, you need the devel package for libxrandr (libxrandr-devel on ubuntu-systems)

if you get the error "Please set the following variables: FONTCONFIG_INCLUDE_DIR, FONTCONFIG_LIBRARIES (ADVANCED)", then you need to install the libfontconfig headers

if you get the error "CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: KMETADATA_LIBRARIES", you need to install soprano from kdesupport and to rebuild kdelibs

if you get the error "‘XserverRegion’ does not name a type" make sure you have libxcomposite headers installed (libxcomposite-dev in ubuntu)

if you get the error "CMake Error: This project requires some variables to be set, and cmake can not find them. Please set the following variables: QT_QTOPENGL_LIBRARY (ADVANCED) ", try editing CMakeCache.txt and setting QT_QTOPENGL_LIBRARY:FILEPATH=/home/kde-devel/qt-copy/lib/libQtOpenGL.so

if you get messages as "KDE4_INSTALL_HANDBOOK() is deprecated. Remove it please. Now all is done in KDE4_CREATE_HANDBOOK." then, either find the files containing the offending line and comment it out manually, or run the following script in ~/kde/src/KDE/kdebase: macros_corrector.sh. It will just REMOVE the line that has "kde4_create_handbook" in it from all the found files.

If you get an error (in ubuntu) concerning libxtst.so install the libxtst-dev package

If you get the message "kdebase/workspace/kcontrol/kxkb/x11helper.cpp:131: error: ‘KGlobal’ has not been declared", you might need to install libxklavier development packages.

Although the API documentation for KDE is available online at api.kde.org, it is sometimes useful to have it on your own disk, for example when you want to use KDevelop for browsing the documentation or when you are not able to be online all the time.

Be aware that generating the API documentation can take several hours and takes almost half a gigabyte of diskspace.
The generation is handled by a script in kdelibs/doc/api, you need doxygen to be able to run it.

In order to keep the kde4 installation up to date, each of the modules installed should be updated periodically. As Monday is the day for big changes in kdelibs, Tuesday may be the best day to do this. For each module checked out, run svn up and make.

For example:

cs kdesupport # cs is not a typosvn up
cb # cb is not a typomake-j2VERBOSE=1&&makeinstall

Many modules in KDE contain a large number of programs which could take a long time to download and compile. In cases where you want to work only on a particular program or programs in a module, it is possible to download and compile particular folders. In some cases, certain folders are required for any build of the module. This is determined in the CMakeLists.txt file of the module. For example the kdegames CMakeLists.txt file lists:

So, the libkdegames and libkmahjongg directories are required to build any of kdegames. The cmake directory will also usually be required. All the other directories (doc, katomic etc) are optional. They will be built if present on your machine. In this example, we build kmahjongg and kbattleship:

What can happen over time, after some svn up commands, is that some of the tools used in the KDE build chain change their output format. For example, kcfg files are read by kconfig_compiler to produce configuration dialogs. CMake cannot detect those changes, and the compilation might fail. A workaround is to always force a re-generation of all such files: