Difference between revisions of "Guidelines and HOWTOs/CMake"

Jump to: navigation, search
Line 17: Line 17:
 
Don't forget to replace both paths. If you want an explanation of what this command does and how to make CMake behave differently, or you want to build on Windows or OS/X, see [[Guidelines HOWTOs/CMake/Building]].
 
Don't forget to replace both paths. If you want an explanation of what this command does and how to make CMake behave differently, or you want to build on Windows or OS/X, see [[Guidelines HOWTOs/CMake/Building]].
  
==Extra CMake Modules==
+
==Useful resources==
* [[Development/ECM_SourceIncompatChanges|Source Incompatible changes]]
+
 
* [http://api.kde.org/ecm API documentation]
+
You may want to check out the [http://www.cmake.org/Wiki/CMake CMake wiki], although beware that it contains quite a bit of out-of-date information.
 +
 
 +
===Reference documentation===
 +
* [http://www.cmake.org/HTML/Documentation.html CMake's own documentation]
 +
* [http://api.kde.org/ecm Extra CMake Modules documentation]
 +
 
 +
===Upgrading from KDELibs4===
 +
 
 +
KDELibs4 made lots of modifications to the CMake environment, and provided lots of custom macros that wrapped CMake's own ones. We now try to avoid that, but this means that moving an existing project from KDELibs4 to KDE Frameworks involves making some changes. A list of these changes can be found at [[Guidelines HOWTOs/CMake/IncompatibleChangesKDELibs4ToECM]].
 +
 
 +
===FAQs===
 +
 
 +
* [[Guidelines HOWTOs/CMake/FAQs|KDE's CMake FAQs]]
 +
* [http://www.cmake.org/Wiki/CMake_FAQ CMake FAQ on the CMake wiki]
 +
 
 +
===Mailing lists===
 +
 
 +
;[http://mail.kde.org/pipermail/kde-buildsystem/ The kde-buildsystem mailing list]
 +
:Discussion of CMake in the KDE community, as well as development of Extra CMake Modules.
 +
;[http://www.cmake.org/mailman/listinfo/cmake CMake mailing list]
 +
:For users of CMake.
 +
;[http://www.cmake.org/mailman/listinfo/cmake-developers CMake mailing list]
 +
:For anyone wanting to contribute to CMake.
  
 
== KDE4 Specific CMake Documentation==
 
== KDE4 Specific CMake Documentation==
Line 44: Line 66:
 
:''How to integrate a Python project into the KDE4 cmake system.''
 
:''How to integrate a Python project into the KDE4 cmake system.''
  
 +
;[http://www.cmake.org/Wiki/HowToBuildKDE4Software KDE 4 Tutorial at the CMake Wiki ]
 +
:"KDE4 tutorial"
  
 
===Policies===
 
===Policies===
Line 69: Line 93:
 
;[[Guidelines HOWTOs/CMake_KDE_4_2 |Changes in the buildsystem with KDE 4.2]]
 
;[[Guidelines HOWTOs/CMake_KDE_4_2 |Changes in the buildsystem with KDE 4.2]]
 
:''What has changed in KDE 4.2 compared to KDE 4.0/4.1''
 
:''What has changed in KDE 4.2 compared to KDE 4.0/4.1''
 
==More Places to learn about CMake==
 
 
Here are some good places to learn about CMake in general:
 
* [http://www.cmake.org/HTML/Documentation.html CMake Manual]
 
* [http://www.cmake.org/Wiki/CMake CMake Wiki]
 
* [http://www.cmake.org/Wiki/CMake_HowToDoPlatformChecks CMake System Checks ]
 
* [http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftware Finding Optional Packages ]
 
* [http://www.cmake.org/Wiki/HowToBuildKDE4Software KDE 4 Tutorial at the CMake Wiki ]
 
* [http://www.cmake.org/Wiki/CMake_FAQ CMake FAQ]
 
* [http://www.elpauer.org/stuff/learning_cmake.pdf Slides for the "Learning CMake" seminar]
 
* [http://mail.kde.org/pipermail/kde-buildsystem/ The kde-buildsystem Mailing List Archive]
 
 
Also, consider joining the [http://www.cmake.org/mailman/listinfo/cmake CMake mailing list].
 

Revision as of 15:31, 28 July 2015

Most KDE software uses CMake as a buildsystem. This page is the starting point for CMake-related documentation for KDE software.

You should be aware that there are two main development platforms that KDE software is based on: the older kdelibs4, and its replacement, the KDE Frameworks. Quite a bit of KDE software is in the process of transitioning from kdelibs4 to KDE Frameworks, and the way CMake is used is slightly different between the two.


Building a project with CMake

If you just want to build a CMake-based project on a UNIX system, the following recipe will do that:

   cd /path/to/project/source
   mkdir build
   cd build
   cmake -DCMAKE_INSTALL_PREFIX=/where/to/install/to ..
   make
   make install

Don't forget to replace both paths. If you want an explanation of what this command does and how to make CMake behave differently, or you want to build on Windows or OS/X, see Guidelines HOWTOs/CMake/Building.

Useful resources

You may want to check out the CMake wiki, although beware that it contains quite a bit of out-of-date information.

Reference documentation

Upgrading from KDELibs4

KDELibs4 made lots of modifications to the CMake environment, and provided lots of custom macros that wrapped CMake's own ones. We now try to avoid that, but this means that moving an existing project from KDELibs4 to KDE Frameworks involves making some changes. A list of these changes can be found at Guidelines HOWTOs/CMake/IncompatibleChangesKDELibs4ToECM.

FAQs

Mailing lists

The kde-buildsystem mailing list
Discussion of CMake in the KDE community, as well as development of Extra CMake Modules.
CMake mailing list
For users of CMake.
CMake mailing list
For anyone wanting to contribute to CMake.

KDE4 Specific CMake Documentation

CMake tutorial
An introduction to using CMake for KDE4
KDE's CMake FAQ
Some Frequently Asked Questions
KDE CMake modules API
Documentation for all CMake modules in kdelibs (generated from kdelibs svn)
Nightly dashboard builds for KDE
Describes the quality dashboard for KDE and how to set up Nightly builds for it
KDE4 CMake Buildtypes, macros and variables
Documentation for the buildtypes (debugfull, release, ...), macros and variables for building KDE4 software, provided by FindKDE4Internal.cmake (manually written)
Automoc4
Automoc4 documentation.
CMake for Python projects
How to integrate a Python project into the KDE4 cmake system.
KDE 4 Tutorial at the CMake Wiki
"KDE4 tutorial"

Policies

Commit Policy for kdelibs/cmake/modules/
The files in kdelibs/cmake/modules/ are part of the public interface of KDE, some special policies apply to committing there.
Source compatiblity with CMake
This page discusses what has to be taken care of in order to stay source compatible on the CMake level.
Coding style for CMake files
Some guidelines how to write CMake scripts in KDE.

Changelog for KDE's CMake buildsystem

Changes in the buildsystem with KDE 4.5
What has changed in KDE 4.5 compared to KDE 4.4
Changes in the buildsystem with KDE 4.4
What has changed in KDE 4.4 compared to KDE 4.3
Changes in the buildsystem with KDE 4.3
What has changed in KDE 4.3 compared to KDE 4.2
Changes in the buildsystem with KDE 4.2
What has changed in KDE 4.2 compared to KDE 4.0/4.1

Content is available under Creative Commons License SA 4.0 unless otherwise noted.