Bug 401888 - kcoreaddons_add_plugin cannot be used with KDEInstallDirs without deprecation warning
Summary: kcoreaddons_add_plugin cannot be used with KDEInstallDirs without deprecation...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kcoreaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-08 09:17 UTC by Dominik Schmidt
Modified: 2018-12-09 16:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominik Schmidt 2018-12-08 09:17:05 UTC
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.
Comment 1 Michael Pyne 2018-12-09 03:48:32 UTC
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.
Comment 2 Michael Pyne 2018-12-09 03:58:25 UTC
See https://phabricator.kde.org/D17446
Comment 3 Michael Pyne 2018-12-09 16:31:48 UTC
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