KDE6 CMake - Kate plugin trying to link in wrong path
-
Hi,
A while ago I made a plugin for the Kate text editor. This was done when my machine was still running Qt5/KDE5. Since my Manjaro LInux was updated to KDE6 I am in the process of updating this plugin to Qt6, but upon building I am running in a linking error. Obviously the INSTALL_NAMESPACE is interpreted/used differently in Qt6.The build structure looks like this:
In $project_dir I run:rm -rf build/ cmake -B build/ -D CMAKE_BUILD_TYPE=Release -D QT_MAJOR_VERSION=6 cmake --build build/
This was running flawless with Qt5 and would create a $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/
After updating my CMakeLists.txt to use Qt6 I get this error:
[ 0%] Built target kate_gpg_plugin_autogen_timestamp_deps [ 14%] Automatic MOC for target kate_gpg_plugin [ 14%] Built target kate_gpg_plugin_autogen [ 28%] Building CXX object CMakeFiles/kate_gpg_plugin.dir/kate_gpg_plugin_autogen/mocs_compilation.cpp.o [ 42%] Building CXX object CMakeFiles/kate_gpg_plugin.dir/kate_gpg_plugin.cpp.o [ 57%] Building CXX object CMakeFiles/kate_gpg_plugin.dir/GPGKeyDetails.cpp.o [ 71%] Building CXX object CMakeFiles/kate_gpg_plugin.dir/GPGMeWrapper.cpp.o [ 85%] Linking CXX shared module /ktexteditor/kate_gpg_plugin.so /usr/bin/ld: cannot open output file /ktexteditor/kate_gpg_plugin.so: No such file or directory collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/kate_gpg_plugin.dir/build.make:153: /ktexteditor/kate_gpg_plugin.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:653: CMakeFiles/kate_gpg_plugin.dir/all] Error 2 make: *** [Makefile:146: all] Error 2
Where is the "/ktexteditor/" coming from? And is there any way to not use the install folder as the build folder?
-
Hi and welcome to devnet,
I would recommend contacting the Kate developers. They will have more knowledge about the plugin building and installation.
-
After a short discussion in the KDE bug tracker I have found the magic CMake lines and order to make it build with Qt6. Apparently there were some changes to the "kcoreaddons_add_plugin()" CMake call that now requires the KF_DEP_VERSION variable to be set in the very beginning (this wasn't so crucial in Qt5).
-
-
Thanks for the feedback ! :-)