-
User Story
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Consider adding options to pass application libraries and plugins to qt_generate_deploy_app_script().
Use Case
Due to differences in platforms, the deployment of applications consisting of several binaries (executable, dynamically linked libraries, and plugins loaded at runtime) is messy. The only platform where CMake does give sane defaults with GNUInstallDirs is Unix; Windows and macOS (App Bundles) need manual tweaking, see e.g.
https://code.qt.io/cgit/qt/qtdoc.git/tree/examples/demos/documentviewer/app/CMakeLists.txt?h=6.10
# # installation # if(APPLE) set(INSTALL_LIBDIR "Document Viewer.app/Contents/Frameworks") set(INSTALL_PLUGINSDIR "Document Viewer.app/Contents/PlugIns") elseif(WIN32) set(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}) set(INSTALL_LIBDIR ${CMAKE_INSTALL_BINDIR}) set(INSTALL_PLUGINSDIR "plugins") else() set(INSTALL_BINDIR ${CMAKE_INSTALL_BINDIR}) set(INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) set(INSTALL_PLUGINSDIR "plugins") endif() install(TARGETS documentviewer abstractviewer BUNDLE DESTINATION . RUNTIME DESTINATION "${INSTALL_BINDIR}" LIBRARY DESTINATION "${INSTALL_LIBDIR}" ) install(TARGETS ${plugin_targets} DESTINATION "${INSTALL_PLUGINSDIR}" ) # Install Qt libraries and plugins qt_generate_deploy_app_script( TARGET documentviewer OUTPUT_SCRIPT deploy_script NO_UNSUPPORTED_PLATFORM_ERROR NO_TRANSLATIONS ) install(SCRIPT ${deploy_script})
qt_generate_deploy_app_script() does already handle Qt plugins and libraries correctly. Can it be extended to also handle the installation of application libraries and plugins?
- resulted from
-
QTBUG-138476 documentviewer: Fix deployment on macOS, Windows, Linux
-
- Closed
-