Skip to content

Fix build errors if PREFIX is different from ECM's PREFIX.

This ports https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/59/ to kpackage.

For plasma-framework this change fixed that issue:

When plasma-framework and extra-cmake-modules reside in different prefixes, building packages depending on PlasmaQuick fails with

 File or directory
 /gnu/store/…-extra-cmake-modules-5.70.0/include/KF5
 referenced by variable PlasmaQuick_INCLUDE_DIR does not exist !

"/gnu/store/…-extra-cmake-modules-5.70.0" is the of PREFIX of ECM - and obviously PlasmaQuick_INCLUDE_DIR should not point there but to the PREFIX of plasma-framework.

Even if I have no example for building packages depending kpackage failing, I propose applying this change also to kpackge for a good reason: Beside plasma-framework, kpackage is the only KDE package using this code-pattern. As this failed for plasma-framework, chances are high, it will sooner or later fail for kpackage, too.

See https://bugs.kde.org/424483 for details.

Merge request reports