Warning, /packaging/yocto-meta-kf5/classes/cmake_kf5.bbclass is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2014 Johan Thelin <johan.thelin@pelagicore.com>
0002 # SPDX-FileCopyrightText: 2016 S├ębastien Taylor <sebastien@au-zone.com>
0003 # SPDX-FileCopyrightText: 2017-2019 Volker Krause <vkrause@kde.org>
0004 #
0005 # SPDX-License-Identifier: MIT
0006 
0007 inherit cmake_qt5
0008 inherit pkgconfig
0009 
0010 EXTRA_OECMAKE:append:class-native = " \
0011     -DOE_KF5_PATH_HOST_ROOT=${STAGING_DIR_HOST} \
0012     -DBUILD_TESTING=OFF \
0013     -DBUILD_DESIGNERPLUGIN=OFF \
0014 "
0015 
0016 EXTRA_OECMAKE:append:class-target = " \
0017     -DOE_KF5_PATH_HOST_ROOT=${STAGING_DIR_HOST} \
0018     -DBUILD_TESTING=OFF \
0019     -DKF5_HOST_TOOLING=${STAGING_LIBDIR_NATIVE}/cmake \
0020     -DBUILD_DESIGNERPLUGIN=OFF \
0021 "
0022 
0023 DEPENDS:append = " \
0024     extra-cmake-modules \
0025     qttools-native \
0026 "
0027 
0028 # don't bother with translations for host tools
0029 do_configure:prepend:class-native() {
0030     rm -rf ${S}/po
0031 }
0032 
0033 do_compile:prepend() {
0034     export XDG_DATA_DIRS=${STAGING_DATADIR}:$XDG_DATA_DIRS
0035     export LD_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE}:$LD_LIBRARY_PATH
0036 }
0037 
0038 # This function is rather offensive, but it seems to work:
0039 # look into _usr or Export subpathes (depending on CMake version) for CMake target files inside
0040 # the build directory an rewrite absolut pathes to have a OE_KF5_PATH_HOST_ROOT prefix variable
0041 do_install:prepend() {
0042     if [ "0" -ne $(find . -name \*.cmake | grep '_usr\|Export' | wc -l) ]; then
0043         sed -i 's/\"\/usr\//\"\$\{OE_KF5_PATH_HOST_ROOT\}\/usr\//g' $(find . -name "*.cmake" | grep '_usr\|Export')
0044         sed -i 's/\;\/usr\//\;\$\{OE_KF5_PATH_HOST_ROOT\}\/usr\//g' $(find . -name "*.cmake" | grep '_usr\|Export')
0045     fi
0046 }
0047 
0048 BBCLASSEXTEND = "native nativesdk"
0049 
0050 FILES:${PN}:append = " \
0051     ${datadir}/dbus-1/services/*.service \
0052     ${datadir}/dbus-1/system-services/*.service \
0053     ${datadir}/dbus-1/system.d/*.conf \
0054     ${datadir}/knotifications5/*.notifyrc \
0055     ${datadir}/kservices5/*.desktop \
0056     ${datadir}/kservices5/*.protocol \
0057     ${datadir}/kservicetypes5/*.desktop \
0058     ${datadir}/kservices5/*.desktop \
0059     ${datadir}/polkit-1/actions/*.policy \
0060 "
0061 
0062 # TODO "${datadir}/kdevappwizard/templates/*.tar.bz2" is deprecated, remove when all frameworks are ported away
0063 FILES:${PN}-dev:append = " \
0064     ${datadir}/dbus-1/interfaces/*.xml \
0065     ${datadir}/kdevappwizard/templates/*.tar.bz2 \
0066     ${datadir}/kdevfiletemplates/templates/*.tar.bz2 \
0067     ${datadir}/qlogging-categories5 \
0068     ${libdir}/cmake \
0069     ${libdir}/plugins/designer/*.so \
0070     ${prefix}/mkspecs/modules/qt_*.pri \
0071 "