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
I learned that kcoreaddons uses KDE_INSTALL_PLUGINDIR variable for the installation.
I learned that I need to set QT_MAJOR_VERSION instead of QT_VERSION_MAJOR before including the KDEInstallDirs to fix it.
Yes, the order does matter here.