KBibTeX/Development: Difference between revisions
m →Running CMake: Adding a link to TechBase explaining the available build types |
m Formatting path |
||
Line 15: | Line 15: | ||
## The location of your KDE installation, for example {{Path|/usr}}. The command <code>kde4-config --prefix</code> prints this location. Requires root permissions (e. g. via sudo). Caution: This choice will interfere with the package management. | ## The location of your KDE installation, for example {{Path|/usr}}. The command <code>kde4-config --prefix</code> prints this location. Requires root permissions (e. g. via sudo). Caution: This choice will interfere with the package management. | ||
## A directory outside the package management's control, for example {{Path|/usr/local}}. Requires setting some environment variables as explained below. This installation stays available across reboots and is available to all users. Requires root permissions (e. g. via sudo). | ## A directory outside the package management's control, for example {{Path|/usr/local}}. Requires setting some environment variables as explained below. This installation stays available across reboots and is available to all users. Requires root permissions (e. g. via sudo). | ||
## A user-writable directory like {{Path|/tmp/usr}} or {{Path|~/usr}}. Similar to above choice, it requires setting some environment variables, but no root permissions. Many distributions are configured to clean /tmp on reboot. | ## A user-writable directory like {{Path|/tmp/usr}} or {{Path|~/usr}}. Similar to above choice, it requires setting some environment variables, but no root permissions. Many distributions are configured to clean {{Path|/tmp}} on reboot. | ||
# <code>CMAKE_BUILD_TYPE</code> determines the amount of debug information included in the final code. Regular users may set it to <code>release</code>, developers to <code>debug</code>, and for step-by-step debugging <code>debugfull</code> works best. All available options are discussed in the [https://techbase.kde.org/Development/CMake/Addons_for_KDE#Buildtypes CMake documentation in TechBase] | # <code>CMAKE_BUILD_TYPE</code> determines the amount of debug information included in the final code. Regular users may set it to <code>release</code>, developers to <code>debug</code>, and for step-by-step debugging <code>debugfull</code> works best. All available options are discussed in the [https://techbase.kde.org/Development/CMake/Addons_for_KDE#Buildtypes CMake documentation in TechBase] | ||
Revision as of 17:45, 4 January 2015
Getting the Source Code
KBibTeX's source is available through KDE's git infrastructure. The repository's name is kbibtex
. How to clone a Git repository is explained in the Git Recipes in TechBase.
Compiling the Code
The following instructions provide information how to compile KBibTeX on the command line. When compiling KBibTeX from inside of an IDE like KDevelop or Qt Creator, those settings have to be applied as well.
Running CMake
KBibTeX is configured using CMake. There are a few options relevant for the configuration of this project:
CMAKE_INSTALL_PREFIX:PATH
specifies the installation location. There are a number of choices available for this option:- The location of your KDE installation, for example /usr. The command
kde4-config --prefix
prints this location. Requires root permissions (e. g. via sudo). Caution: This choice will interfere with the package management. - A directory outside the package management's control, for example /usr/local. Requires setting some environment variables as explained below. This installation stays available across reboots and is available to all users. Requires root permissions (e. g. via sudo).
- A user-writable directory like /tmp/usr or ~/usr. Similar to above choice, it requires setting some environment variables, but no root permissions. Many distributions are configured to clean /tmp on reboot.
- The location of your KDE installation, for example /usr. The command
CMAKE_BUILD_TYPE
determines the amount of debug information included in the final code. Regular users may set it torelease
, developers todebug
, and for step-by-step debuggingdebugfull
works best. All available options are discussed in the CMake documentation in TechBase
Complete example: cmake ../kbibtex -DCMAKE_INSTALL_PREFIX:PATH=/tmp/usr -DCMAKE_BUILD_TYPE=debug
Compiling
GNU Make is the default choice for source code compilation. The number of parallel processes should be specified to shorten the time to finish on multi-core systems. The priority of the compilation tasks may get reduced. Example: nice -n 16 make -j4
.
Installation
KBibTeX uses KDE 4's KParts technology, which requires you to install some libraries. KBibTeX may not run properly if the following steps are omitted.
Running make install will install KBibTeX into the directory as specified as installation prefix earlier. Unless the installation prefix equals KDE install directory, the following environment variables have to be specified and commands have to be executed:
- Set variable
KDEDIRS
to include the KDE installation directory and KBibTeX's installation directory, for example /usr:/tmp/usr - Set variable
LD_LIBRARY_PATH
to the library directory inside the installation directory, for example /tmp/usr/lib64 - Set variable
XDG_DATA_HOME
to the installation directory's shared data directory, for example /tmp/usr/share - Set variable
XDG_DATA_DIRS
to include the shared data directories of the KDE installation directory, KBibTeX's installation directory, and other relevant prefixes, for example /usr/share:/usr/local/share:/tmp/usr/share - Run
kbuildsycoca4
Now KBibTeX can be started.