Bundle selected Qt plugins on Windows

This commit is contained in:
Janek Bevendorff 2018-02-27 03:52:15 +01:00 committed by Jonathan White
parent c1a397e624
commit 114f87c6b4

View File

@ -380,9 +380,18 @@ if(MINGW)
" COMPONENT Runtime) " COMPONENT Runtime)
include(DeployQt4) include(DeployQt4)
install_qt4_executable(${PROGNAME}.exe)
add_custom_command(TARGET ${PROGNAME} POST_BUILD # install Qt5 plugins
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${Qt5_PREFIX}/share/qt5/plugins/platforms/qwindows$<$<CONFIG:Debug>:d>.dll set(PLUGINS_DIR ${Qt5_PREFIX}/share/qt5/plugins)
$<TARGET_FILE_DIR:${PROGNAME}>) install(FILES ${PLUGINS_DIR}/platforms/qwindows$<$<CONFIG:Debug>:d>.dll DESTINATION "platforms")
install(FILES $<TARGET_FILE_DIR:${PROGNAME}>/qwindows$<$<CONFIG:Debug>:d>.dll DESTINATION "platforms") install(FILES ${PLUGINS_DIR}/platforminputcontexts/qtvirtualkeyboardplugin$<$<CONFIG:Debug>:d>.dll DESTINATION "platforminputcontexts")
install(FILES ${PLUGINS_DIR}/iconengines/qsvgicon$<$<CONFIG:Debug>:d>.dll DESTINATION "iconengines")
install(FILES
${PLUGINS_DIR}/imageformats/qgif$<$<CONFIG:Debug>:d>.dll
${PLUGINS_DIR}/imageformats/qicns$<$<CONFIG:Debug>:d>.dll
${PLUGINS_DIR}/imageformats/qico$<$<CONFIG:Debug>:d>.dll
${PLUGINS_DIR}/imageformats/qjpeg$<$<CONFIG:Debug>:d>.dll
${PLUGINS_DIR}/imageformats/qsvg$<$<CONFIG:Debug>:d>.dll
${PLUGINS_DIR}/imageformats/qwebp$<$<CONFIG:Debug>:d>.dll
DESTINATION "imageformats")
endif() endif()