SUMMARY kcoreaddons_add_plugin uses PLUGIN_INSTALL_DIR[1] which is deprecated in KDEInstallDirs. So either you get a lot of warnings from KDEInstallDirs because you did not set KDE_INSTALL_DIRS_NO_DEPRECATED to true or you need to set set(PLUGIN_INSTALL_DIR "${KDE_INSTALL_PLUGINDIR}") after doing so in order to make kcoreaddons_add_plugin work. [1] https://github.com/KDE/kcoreaddons/blob/2af64ee1e2953fb0db58885bb093897ea38972f3/KF5CoreAddonsMacros.cmake STEPS TO REPRODUCE 1. set(KDE_INSTALL_DIRS_NO_DEPRECATED TRUE) to avoid deprecation warnings 2. include(KDEInstallDirs) 3. kcoreaddons_add_plugin(...) OBSERVED RESULT Installation lacks the PLUGIN_DIR prefix and tries to install to ${INSTALL_NAMESPACE} in "/". EXPECTED RESULT Plugin is correctly installed into prefix.
This might be as simple as just replacing PLUGIN_INSTALL_DIR with KDE_INSTALL_PLUGINDIR. That change made here locally and then tested by building kactivitymanagerd seems to work correctly. I'll add it as a Phabricator review to make sure I'm not missing anything.
See https://phabricator.kde.org/D17446
Git commit 1285c4bf5552405a3932eb631029de39ec91031d by Michael Pyne. Committed on 09/12/2018 at 16:27. Pushed by mpyne into branch 'master'. cmake macros: Port away from deprecated ECM var in kcoreaddons_add_plugin The current kcoreaddons_add_plugin CMake macro causes deprecation warnings in extra-cmake-module's KDEInstallDirs since we use an old-style install path variable (PLUGIN_INSTALL_DIR). The fix is simply to use KDE_INSTALL_PLUGINDIR instead. FIXED-IN:5.54 Differential Revision: https://phabricator.kde.org/D17446 M +2 -2 KF5CoreAddonsMacros.cmake https://commits.kde.org/kcoreaddons/1285c4bf5552405a3932eb631029de39ec91031d