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)
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$<$<CONFIG:Debug>:d>.dll
$<TARGET_FILE_DIR:${PROGNAME}>)
install(FILES $<TARGET_FILE_DIR:${PROGNAME}>/qwindows$<$<CONFIG:Debug>:d>.dll DESTINATION "platforms")
# install Qt5 plugins
set(PLUGINS_DIR ${Qt5_PREFIX}/share/qt5/plugins)
install(FILES ${PLUGINS_DIR}/platforms/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()