Bug 480107

Summary: kcoreaddons_add_plugin installs in a wrong directory
Product: [Frameworks and Libraries] extra-cmake-modules Reporter: Matin Lotfaliei <matinlotfali>
Component: generalAssignee: ecm-bugs-null <ecm-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kdelibs-bugs, nate, nicolas.fella
Priority: NOR    
Version: 5.248.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Matin Lotfaliei 2024-01-20 21:17:43 UTC
SUMMARY
the kcoreaddons_add_plugin command installs the plugin in the wrong location.

STEPS TO REPRODUCE
1. run cmake install in a project that uses kcoreaddons_add_plugin and see the installed locations

OBSERVED RESULT
Installs the plugin in /usr/lib/x86_64-linux-gnu/plugins

EXPECTED RESULT
Install the plugin in /usr/lib/x86_64-linux-gnu/qt6/plugins

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Latest Neon Unstable and Fedora Rawhide


ADDITIONAL INFORMATION
It might be related to another bug https://bugs.kde.org/show_bug.cgi?id=461487
Comment 1 Matin Lotfaliei 2024-01-21 03:43:08 UTC
I learned that kcoreaddons uses KDE_INSTALL_PLUGINDIR variable for the installation.
Comment 2 Matin Lotfaliei 2024-01-21 04:26:55 UTC
I learned that I need to set QT_MAJOR_VERSION instead of QT_VERSION_MAJOR before including the KDEInstallDirs to fix it.
Comment 3 Nate Graham 2024-01-23 19:20:31 UTC
Yes, the order does matter here.