https://bugs.kde.org/show_bug.cgi?id=487214
Bug ID: 487214
Summary: "kcoreaddons_add_plugin" attempts to link plugin in
/INSTALL_NAMESPACE
Classification: Frameworks and Libraries
Product: extra-cmake-modules
Version: 6.1.0
Platform: Manjaro
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: general
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
SUMMARY
I am trying to migrate a Kate plugin from Qt5.15.* to 6.1. The CMakeLists.txt
is calling
kcoreaddons_add_plugin(my_plugin_name
INSTALL_NAMESPACE "ktexteditor"),
which with Qt6 builds the sources but fails upon linking because it is trying
to link not in the build folder but in
/INSTALL_NAMESPACE, i.e. in
/ktexteditor
(For Qt6 the install namespace should be kf6/ktexteditor).
STEPS TO REPRODUCE
In $project_dir I run:
rm -rf build/
cmake -B build/ -D CMAKE_BUILD_TYPE=Release -D QT_MAJOR_VERSION=6 (or 5)
cmake --build build/
This is working fine with Qt5 and will create ./build/plugin_name.so in the
build folder. A subsequent
sudo cmake --install build/
would then copy the plugin .so to
/usr/lib/qt/plugins/ktexteditor/
With Qt6 I am getting a linker error:
cmake --build build/
[......]
[ 85%] Linking CXX shared module /kf6/ktexteditor/my_plugin.so
/usr/bin/ld: cannot open output file /kf6/ktexteditor/my_plugin.so: No such
file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/my_plugin.dir/build.make:153:
/kf6/ktexteditor/my_plugin.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:653: CMakeFiles/my_plugin.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
OBSERVED RESULT
cmake --build build/
attempts to link the plugin .so in /kf6/ktexteditor/
EXPECTED RESULT
cmake --build build/
should link the plugin .so in ./build/
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0
ADDITIONAL INFORMATION
--
You are receiving this mail because:
You are watching all bug changes.