qt_generate_deploy_app_script fails to deploy necessary libs and platform plugins on Ubuntu 22.04 LTS
-
Using Cmake, we link against several Qt libraries
find_package(Qt6 COMPONENTS Widgets Core Gui Sql Xml Network OpenGL UiTools Qml Quick QuickWidgets WebSockets Multimedia OpenGLWidgets REQUIRED) target_link_libraries(OurApp ${LIBS} Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Sql Qt6::Xml Qt6::Network Qt6::Qml Qt6::QuickWidgets Qt6::WebSockets Qt6::Multimedia)
and we have a distribution macro tailored per-platform, the Linux version using the built-in Cmake-function provided by Qt6
macro(copy_dlls TARGET_NAME) qt_finalize_target(${TARGET_NAME}) qt_generate_deploy_app_script( TARGET ${TARGET_NAME} OUTPUT_SCRIPT linuxdeployqt NO_UNSUPPORTED_PLATFORM_ERROR NO_TRANSLATIONS ) install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(SCRIPT ${linuxdeployqt}) endmacro()
This mostly works except with two critical failures
-
Libraries for Qt Widgets, QuickWidgets, and Xml are not copied.
-
Only Xcb platform plugin is copied, but Ubuntu uses Wayland.
I cannot find any information on how to select which platform plugins should be used, and have no theory whatsoever why deployment would ignore some libraries (especially a crucial one like Widgets). How do I go about ensuring the right libraries and plugins are included in the deployment?
-
-
To add to this, I managed to hack around by looping over the Qt libraries we include and copying manually, however with another target the Qt deployment is refusing to copy libicuuc, libicudata, and libicuil8n, all of which come from Qt but we're not linking to directly. How is this deployment supposed to work exactly? Are we just using it completely wrong?