New "official" way how to use an installed kdelibs from the frameworks branch

Alexander Neundorf neundorf at kde.org
Fri Feb 8 00:29:42 UTC 2013


On Friday 08 February 2013, Alexander Neundorf wrote:
> Hi,
> 
> after looking at the current plasma-framework buildsystem I worked a bit on
> the kdelibs and plasma buildsystem, and there is now a somewhat sane way to
> use an installed kdelibs from the frameworks branch.
> 
> So, compared to kdelibs before, now FindKDE4Internal.cmake is no longer
> installed.
> Instead kdelibs now installs a KDELibs4Config.cmake, which (still) contains
> most of what was in FindKDE4Internal.cmake.
> KDELibs4Config.cmake is installed into lib/cmake/KDELibs4/, i.e. in a
> directory where cmake searches for Config.cmake files in NO_MODULE mode.
> 
> KDELibs4Config.cmake does not contain cmake- or compiler settings anymore.
> This must now come from extra-cmake-modules by finding KF5:
> 
> find_package(KF5 MODULE REQUIRED CMake Compiler InstallDirs)
> 
> This "finds" KF5 and the meta-components
> * CMake : cmake settings, e.g. RPATH handling
> * Compiler : the compiler switches we had in FindKDE4Internal.cmake
> * InstallDirs : the install dir variables as they were in
> FindKDE4Internal.cmake
> 
> When searching KDELibs4, the tier1 libraries and ki18n the order matters.
> 
> The tier1 libs don't depend on anything, so they must be searched first.
> ki18n must also be searched before KDELibs4, because libraries in KDELibs4
> depend on it, and it fails otherwise.
> 
> What I committed/pushed is not perfect, but at least somewhat sane, and it
> kind of works.
> 
> Let me know if it doesn't for you.

Attached is a minimal example of how to use it.

Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CMakeLists.txt
Type: text/x-cmake
Size: 718 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20130208/a893e22a/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 76 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20130208/a893e22a/attachment.cpp>


More information about the Kde-buildsystem mailing list