From 114f87c6b439a815c5e58718e1ed5577b2d759b5 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 27 Feb 2018 03:52:15 +0100 Subject: [PATCH] Bundle selected Qt plugins on Windows --- src/CMakeLists.txt | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10a06e0fc..f5deeb2ee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -380,9 +380,18 @@ if(MINGW) " COMPONENT Runtime) include(DeployQt4) - install_qt4_executable(${PROGNAME}.exe) - add_custom_command(TARGET ${PROGNAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${Qt5_PREFIX}/share/qt5/plugins/platforms/qwindows$<$:d>.dll - $) - install(FILES $/qwindows$<$:d>.dll DESTINATION "platforms") + + # install Qt5 plugins + set(PLUGINS_DIR ${Qt5_PREFIX}/share/qt5/plugins) + install(FILES ${PLUGINS_DIR}/platforms/qwindows$<$:d>.dll DESTINATION "platforms") + install(FILES ${PLUGINS_DIR}/platforminputcontexts/qtvirtualkeyboardplugin$<$:d>.dll DESTINATION "platforminputcontexts") + install(FILES ${PLUGINS_DIR}/iconengines/qsvgicon$<$:d>.dll DESTINATION "iconengines") + install(FILES + ${PLUGINS_DIR}/imageformats/qgif$<$:d>.dll + ${PLUGINS_DIR}/imageformats/qicns$<$:d>.dll + ${PLUGINS_DIR}/imageformats/qico$<$:d>.dll + ${PLUGINS_DIR}/imageformats/qjpeg$<$:d>.dll + ${PLUGINS_DIR}/imageformats/qsvg$<$:d>.dll + ${PLUGINS_DIR}/imageformats/qwebp$<$:d>.dll + DESTINATION "imageformats") endif()