KDE Frameworks/Getting Started/Build/For Beginners: Difference between revisions
(Created page with "Most of the software produced by KDE uses [https://cmake.org/ CMake] to control how it is built and installed. If you're not used to building software that uses CMake, don't w...") |
|||
Line 12: | Line 12: | ||
;Building | ;Building | ||
: Calls the compiler, linker and other tools to create the libraries, executables and other files that are part of the "finished product". | : Calls the compiler, linker and other tools to create the libraries, executables and other files that are part of the "finished product". The descriptions generated in the previous step control how this is done. | ||
;Installing | ;Installing |
Revision as of 21:18, 28 October 2015
Most of the software produced by KDE uses CMake to control how it is built and installed. If you're not used to building software that uses CMake, don't worry! This guide will teach you how.
Overview
The build process follows four basic steps:
- Configuring
- Determines what is available on the system, where to find it and how to use it. For example, do you have a C++ compiler? What arguments will need to be passed to it? Do you have the required libraries? Where can they be found?
- Generating
- Using the information gathered in the previous step, creates files that describe how to build the project.
- Building
- Calls the compiler, linker and other tools to create the libraries, executables and other files that are part of the "finished product". The descriptions generated in the previous step control how this is done.
- Installing
- Copies the files that were built (and possibly some other resources) to the right locations on the system.
There is also an optional extra step, running automated tests, which can happen either before or after installing.
CMake is used to perform the configuring and generating steps. The build description it generates is then used by another tool - typically Make on UNIX systems - to do the building and installing steps. Running the automated tests is done by CTest, which ships as part of CMake.
Prerequisites
Before you can start, you will need to install a few pieces of software.
- Build environment
- There is usually a fairly easy way to get the basic software you will need to build C++ programs. For example, most Linux distributions offer a "virtual package" that includes a C++ compiler, Make and other useful tools (eg: Debian calls this "build-essential"). On Windows, you might use Visual Studio, while OS X has XCode. You will need to find out how to get this for your particular system.
- CMake
- On Linux systems, you can usually get this through your package manager. Otherwise, you will need to download and install it. You will need at least version 2.8.12.
- Qt
- Almost all software produced by KDE is built on top of Qt, so it would be sensible to get hold of it now. Again, you can get it via your package manager on Linux, or download it yourself. Watch out, though! While a lot of KDE software is using Qt 5 (you'll probably want at least 5.4 if possible), some is still using Qt 4 (specifically 4.8). These are not compatible. The general rule is: software using KDE Frameworks needs Qt 5, software using kdelibs needs Qt 4.
Running CMake
TODO: examples, etc.
Building
make (and other systems?)
Installing
make install (and other systems?)
A Simpler Way
TODO: link to kdesrc-build instructions