Difference between revisions of "Development/CMake KDE 4 5"

Jump to: navigation, search
(New libraries: knewstuff3, kunitconversion and kdewebkit)
(Other minor changes)
 
(4 intermediate revisions by one user not shown)
Line 5: Line 5:
 
==Incompatible Changes==
 
==Incompatible Changes==
  
===FindQt4.cmake: Imported Targets for the libraries===
+
We are not aware of any incompatible changes between KDE 4.4 and 4.5.
 
+
 
+
  
  
Line 16: Line 14:
  
 
Starting with KDE 4.5, CMake >= 2.6.4 is required (KDE 4.2 to 4.4 required 2.6.2).
 
Starting with KDE 4.5, CMake >= 2.6.4 is required (KDE 4.2 to 4.4 required 2.6.2).
 +
 +
This change brings us mainly two new features:
 +
* The find_package() command now additionally
 +
searches in lib/cmake/Foo/ for installed FooConfig.cmake files, while CMake
 +
2.6.0..2.6.2 only look in lib/Foo/cmake/. With CMake < 2.6.3 manual work was required to be able to find these files, now with CMake 2.6.4 it just works and we are compatible to all other CMake-based packages which install their files in such locations.
 +
* You can now use parenthesis in if()-statements, so you can do now e.g.
 +
if(FOO AND (BAR OR BLAH))
  
 
===Commit Policy for kdelibs/cmake/modules/===
 
===Commit Policy for kdelibs/cmake/modules/===
Line 21: Line 26:
 
The [[Policies/CMake_Commit_Policy|commit policy]] introduced during the 4.3 development cycle is still active and must be followed.
 
The [[Policies/CMake_Commit_Policy|commit policy]] introduced during the 4.3 development cycle is still active and must be followed.
  
===Major FindQt4.cmake improvements===
+
===New variable KDE_PLATFORM_PROFILE===
  
A lot of work went into FindQt4.cmake. This includes:
+
The new variable KDE_PLATFORM_PROFILE can be used to test for which profile
* Synced with FindQt4.cmake from CMake 2.8.0. Our version and the one shipped with CMake 2.8.0 are now almost identical again, there are only a bunch of minor differences left.
+
KDE is currently built for. Possible values are "Desktop", "Tablet" and "Mobile".
* Support for Qt 4.6 added. I.e. support for the QtMultimedia and QtScriptTools libraries has been added.
+
* Support for ActiveQt (Windows only) has been added.
+
* New variables QT_COLLECTIONGENERATOR_EXECUTABLE, QT_DESIGNER_EXECUTABLE and QT_LINGUIST_EXECUTABLE.
+
* New macros QT4_CREATE_TRANSLATION() and QT4_ADD_TRANSLATION().
+
* Improved support for Mac OSX, including Qt installed as frameworks
+
* Improved support for Windows, including handling release/debug libraries (see "Imported targets")
+
* Support for static Qt libraries and the UseQt.cmake file fixed.
+
* FindQt4.cmake has been split into FindQt4.cmake, Qt4Macros.cmake and Qt4ConfigDependentSettings.cmake.
+
* Improved support for flexible Qt install locations under Windows (see "Imported targets")
+
  
'''Imported Targets'''
+
===New libraries: kemoticons, kidletime, kcmutils and kprintutils===
  
FindQt4.cmake now creates an imported library target for each of the Qt libraries which has been found. These imported targets can then be used like "normal" targets in CMakeLists.txt, e.g. in TARGET_LINK_LIBRARIES().
+
With KDE 4.5 3 four new libraries were added to kdelibs: the kemoticons library, the kidletime library, the kcmutils library and the kprintutils library. These libraries come with their associated variables. So if you want to link against these libraries, use ${KDE4_KEMOTICONS_LIBS}, ${KDE4_KIDLETIME_LIBS}, ${KDE4_KCMUTILS_LIBS} and ${KDE4_KPRINTUTILS_LIBS} respectively. They don't require an additional include directory.
These imported targets are named "Qt4::<library name>", e.g. Qt4::QtCore or Qt4::QtGui.
+
This brings several advantages:
+
* one imported library can have different locations for different buildtypes, i.e. for debug builds its IMPORTED_LOCATION_DEBUG property can point to the debug version of the library, while its IMPORTED_LOCATION_RELEASE property can point to the release version of the library
+
* If some library kfoo links against such an imported Qt4 library, and kfoo is exported, the export file will list Qt4::QtCore etc. as dependency, and not the absolute file path to the QtCore library. This has the big advantage, that the location of the QtCore library (and the other Qt libraries) is resolved at cmake-time of the software which uses kfoo, and not fixed to the location of QtCore where it was when kfoo was built. This is especially helpful for installing and building against KDE on Windows.
+
  
If the variable QT_USE_IMPORTED_TARGETS is set to TRUE before FindQt4.cmake is executed, also the Qt library variables like QT_QTCORE_LIBRARY are set to point to these imported targets instead to the file path. This is the case automatically when doing a find_package(KDE4).
+
===Improved RPATH settings===
  
===New libraries: kemoticons, kidletime, kcmutils and kprintutils===
+
In the previous releases of KDE 4, the library installation directory was always added to the RPATH of libraries and executables.
 +
With KDE 4.5 this is now only done if the library installation directory is not one of the system default library directories.
 +
This means that e.g. /usr/lib is not added anymore to the RPATH.
  
With KDE 4.5 3 four new libraries were added to kdelibs: the kemoticons library, the kidletime library, the kcmutils library and the kprintutils library. These libraries come with their associated variables. So if you want to link against these libraries, use ${KDE4_KEMOTICONS_LIBS}, ${KDE4_KIDLETIME_LIBS}, ${KDE4_KCMUTILS_LIBS} and ${KDE4_KPRINTUTILS_LIBS} respectively. They don't require an additional include directory.
+
===Support for QtDeclarative===
  
===New kdecore component KAuth===
+
Support for the new QtDeclarative module has been added to FindQt4.cmake. To use it, you can use the new variables QT_QTDECLARATIVE_LIBRARY, QT_QTDECLARATIVE_INCLUDE_DIR, QT_QTDECLARATIVE_FOUND and QT_USE_QTDECLARATIVE.
 
+
With KDE 4.4 the kdecore library now contains a new authorization component, called KAuth, which support PolicyKit. Along with it come two new macros, KDE4_INSTALL_AUTH_ACTIONS() and KDE4_INSTALL_AUTH_HELPER_FILES(). These macros help with generating and installing the policy action files.
+
  
 
===Other minor changes===
 
===Other minor changes===
  
* The file MacroAddFileDependencies.cmake has been removed. It is not shipped anymore since this file is part of CMake 2.6.2, which we still depend on for KDE 4.4. So it is not necessary to keep an identical copy in KDE.
+
* A cache variable KDE4_SERIALIZE_TOOL has been added to FindKDE4Internal.cmake. It is empty by default,  
 
+
but you can set it to a tool to serialize resource-intensive commands in parallel builds, e.g. icecc when using icecream .
* A new install location variable DBUS_SYSTEM_SERVICES_INSTALL_DIR has been added. It defaults  to ${CMAKE_INSTALL_PREFIX}/share/dbus-1/system-services/ . You probably want to set it to some system wide location.
+
  
* Macro KDE4_ADD_KCFG_FILES(): new optional argument USE_RELATIVE_PATH. Use this option to specify the (relative) path where the generated files will be put.
+
* Some improvements to make cross compiling KDE easier were committed to FindKDE4Internal.cmake, but we are still not ready for cross compiling.
  
* Support for building KDE4 on GNU Hurd has been improved.
+
* The documentation was improved, e.g. the macro KDE4_ADD_APP_ICON() was undocumented before.
  
 
==New Modules==
 
==New Modules==

Latest revision as of 20:37, 15 August 2010

Contents

[edit] Changes in the buildsystem from KDE 4.4 to KDE 4.5

Starting with KDE 4.5, CMake >= 2.6.4 is required.

[edit] Incompatible Changes

We are not aware of any incompatible changes between KDE 4.4 and 4.5.


[edit] Other Changes

[edit] Required CMake version

Starting with KDE 4.5, CMake >= 2.6.4 is required (KDE 4.2 to 4.4 required 2.6.2).

This change brings us mainly two new features:

  • The find_package() command now additionally

searches in lib/cmake/Foo/ for installed FooConfig.cmake files, while CMake 2.6.0..2.6.2 only look in lib/Foo/cmake/. With CMake < 2.6.3 manual work was required to be able to find these files, now with CMake 2.6.4 it just works and we are compatible to all other CMake-based packages which install their files in such locations.

  • You can now use parenthesis in if()-statements, so you can do now e.g.

if(FOO AND (BAR OR BLAH))

[edit] Commit Policy for kdelibs/cmake/modules/

The commit policy introduced during the 4.3 development cycle is still active and must be followed.

[edit] New variable KDE_PLATFORM_PROFILE

The new variable KDE_PLATFORM_PROFILE can be used to test for which profile KDE is currently built for. Possible values are "Desktop", "Tablet" and "Mobile".

[edit] New libraries: kemoticons, kidletime, kcmutils and kprintutils

With KDE 4.5 3 four new libraries were added to kdelibs: the kemoticons library, the kidletime library, the kcmutils library and the kprintutils library. These libraries come with their associated variables. So if you want to link against these libraries, use ${KDE4_KEMOTICONS_LIBS}, ${KDE4_KIDLETIME_LIBS}, ${KDE4_KCMUTILS_LIBS} and ${KDE4_KPRINTUTILS_LIBS} respectively. They don't require an additional include directory.

[edit] Improved RPATH settings

In the previous releases of KDE 4, the library installation directory was always added to the RPATH of libraries and executables. With KDE 4.5 this is now only done if the library installation directory is not one of the system default library directories. This means that e.g. /usr/lib is not added anymore to the RPATH.

[edit] Support for QtDeclarative

Support for the new QtDeclarative module has been added to FindQt4.cmake. To use it, you can use the new variables QT_QTDECLARATIVE_LIBRARY, QT_QTDECLARATIVE_INCLUDE_DIR, QT_QTDECLARATIVE_FOUND and QT_USE_QTDECLARATIVE.

[edit] Other minor changes

  • A cache variable KDE4_SERIALIZE_TOOL has been added to FindKDE4Internal.cmake. It is empty by default,

but you can set it to a tool to serialize resource-intensive commands in parallel builds, e.g. icecc when using icecream .

  • Some improvements to make cross compiling KDE easier were committed to FindKDE4Internal.cmake, but we are still not ready for cross compiling.
  • The documentation was improved, e.g. the macro KDE4_ADD_APP_ICON() was undocumented before.

[edit] New Modules

Some completely new installed modules have been added during this cycle:

  • FindDBusMenuQt.cmake


Also added were FindDocBookXML.cmake and FindDocBookXSL.cmake, but both are used only internally inside kdelibs and both are not installed.


This page was last modified on 15 August 2010, at 20:37. This page has been accessed 2,587 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal