CopyYuzuQt5Deps.cmake 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. function(copy_yuzu_Qt5_deps target_dir)
  2. include(WindowsCopyFiles)
  3. if (MSVC)
  4. set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
  5. set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
  6. else()
  7. set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/")
  8. set(Qt5_DLL_DIR "${Qt5_DIR}/../../../lib/")
  9. endif()
  10. set(Qt5_PLATFORMS_DIR "${Qt5_DIR}/../../../plugins/platforms/")
  11. set(Qt5_PLATFORMTHEMES_DIR "${Qt5_DIR}/../../../plugins/platformthemes/")
  12. set(Qt5_PLATFORMINPUTCONTEXTS_DIR "${Qt5_DIR}/../../../plugins/platforminputcontexts/")
  13. set(Qt5_XCBGLINTEGRATIONS_DIR "${Qt5_DIR}/../../../plugins/xcbglintegrations/")
  14. set(Qt5_STYLES_DIR "${Qt5_DIR}/../../../plugins/styles/")
  15. set(Qt5_IMAGEFORMATS_DIR "${Qt5_DIR}/../../../plugins/imageformats/")
  16. set(Qt5_RESOURCES_DIR "${Qt5_DIR}/../../../resources/")
  17. set(PLATFORMS ${DLL_DEST}plugins/platforms/)
  18. set(STYLES ${DLL_DEST}plugins/styles/)
  19. set(IMAGEFORMATS ${DLL_DEST}plugins/imageformats/)
  20. if (MSVC)
  21. windows_copy_files(${target_dir} ${Qt5_DLL_DIR} ${DLL_DEST}
  22. icudt*.dll
  23. icuin*.dll
  24. icuuc*.dll
  25. Qt5Core$<$<CONFIG:Debug>:d>.*
  26. Qt5Gui$<$<CONFIG:Debug>:d>.*
  27. Qt5Widgets$<$<CONFIG:Debug>:d>.*
  28. )
  29. if (YUZU_USE_QT_WEB_ENGINE)
  30. windows_copy_files(${target_dir} ${Qt5_DLL_DIR} ${DLL_DEST}
  31. Qt5Network$<$<CONFIG:Debug>:d>.*
  32. Qt5Positioning$<$<CONFIG:Debug>:d>.*
  33. Qt5PrintSupport$<$<CONFIG:Debug>:d>.*
  34. Qt5Qml$<$<CONFIG:Debug>:d>.*
  35. Qt5Quick$<$<CONFIG:Debug>:d>.*
  36. Qt5QuickWidgets$<$<CONFIG:Debug>:d>.*
  37. Qt5WebChannel$<$<CONFIG:Debug>:d>.*
  38. Qt5WebEngine$<$<CONFIG:Debug>:d>.*
  39. Qt5WebEngineCore$<$<CONFIG:Debug>:d>.*
  40. Qt5WebEngineWidgets$<$<CONFIG:Debug>:d>.*
  41. QtWebEngineProcess$<$<CONFIG:Debug>:d>.*
  42. )
  43. windows_copy_files(${target_dir} ${Qt5_RESOURCES_DIR} ${DLL_DEST}
  44. qtwebengine_resources.pak
  45. qtwebengine_devtools_resources.pak
  46. qtwebengine_resources_100p.pak
  47. qtwebengine_resources_200p.pak
  48. icudtl.dat
  49. )
  50. endif ()
  51. windows_copy_files(yuzu ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.*)
  52. windows_copy_files(yuzu ${Qt5_STYLES_DIR} ${STYLES} qwindowsvistastyle$<$<CONFIG:Debug>:d>.*)
  53. windows_copy_files(yuzu ${Qt5_IMAGEFORMATS_DIR} ${IMAGEFORMATS}
  54. qjpeg$<$<CONFIG:Debug>:d>.*
  55. qgif$<$<CONFIG:Debug>:d>.*
  56. )
  57. else()
  58. set(Qt5_DLLS
  59. "${Qt5_DLL_DIR}libQt5Core.so.5"
  60. "${Qt5_DLL_DIR}libQt5DBus.so.5"
  61. "${Qt5_DLL_DIR}libQt5Gui.so.5"
  62. "${Qt5_DLL_DIR}libQt5Widgets.so.5"
  63. "${Qt5_DLL_DIR}libQt5XcbQpa.so.5"
  64. "${Qt5_DLL_DIR}libicudata.so.60"
  65. "${Qt5_DLL_DIR}libicui18n.so.60"
  66. "${Qt5_DLL_DIR}libicuuc.so.60"
  67. )
  68. set(Qt5_IMAGEFORMAT_DLLS
  69. "${Qt5_IMAGEFORMATS_DIR}libqjpeg.so"
  70. "${Qt5_IMAGEFORMATS_DIR}libqgif.so"
  71. "${Qt5_IMAGEFORMATS_DIR}libqico.so"
  72. )
  73. set(Qt5_PLATFORMTHEME_DLLS
  74. "${Qt5_PLATFORMTHEMES_DIR}libqgtk3.so"
  75. "${Qt5_PLATFORMTHEMES_DIR}libqxdgdesktopportal.so"
  76. )
  77. set(Qt5_PLATFORM_DLLS
  78. "${Qt5_PLATFORMS_DIR}libqxcb.so"
  79. )
  80. set(Qt5_PLATFORMINPUTCONTEXT_DLLS
  81. "${Qt5_PLATFORMINPUTCONTEXTS_DIR}libcomposeplatforminputcontextplugin.so"
  82. "${Qt5_PLATFORMINPUTCONTEXTS_DIR}libibusplatforminputcontextplugin.so"
  83. )
  84. set(Qt5_XCBGLINTEGRATION_DLLS
  85. "${Qt5_XCBGLINTEGRATIONS_DIR}libqxcb-glx-integration.so"
  86. )
  87. foreach(LIB ${Qt5_DLLS})
  88. file(COPY ${LIB} DESTINATION "${DLL_DEST}/lib" FOLLOW_SYMLINK_CHAIN)
  89. endforeach()
  90. foreach(LIB ${Qt5_IMAGEFORMAT_DLLS})
  91. file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/imageformats/" FOLLOW_SYMLINK_CHAIN)
  92. endforeach()
  93. foreach(LIB ${Qt5_PLATFORMTHEME_DLLS})
  94. file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/platformthemes/" FOLLOW_SYMLINK_CHAIN)
  95. endforeach()
  96. foreach(LIB ${Qt5_PLATFORM_DLLS})
  97. file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/platforms/" FOLLOW_SYMLINK_CHAIN)
  98. endforeach()
  99. foreach(LIB ${Qt5_PLATFORMINPUTCONTEXT_DLLS})
  100. file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/platforminputcontexts/" FOLLOW_SYMLINK_CHAIN)
  101. endforeach()
  102. foreach(LIB ${Qt5_XCBGLINTEGRATION_DLLS})
  103. file(COPY ${LIB} DESTINATION "${DLL_DEST}plugins/xcbglintegrations/" FOLLOW_SYMLINK_CHAIN)
  104. endforeach()
  105. endif()
  106. # Create an empty qt.conf file. Qt will detect that this file exists, and use the folder that its in as the root folder.
  107. # This way it'll look for plugins in the root/plugins/ folder
  108. add_custom_command(TARGET yuzu POST_BUILD
  109. COMMAND ${CMAKE_COMMAND} -E touch ${DLL_DEST}qt.conf
  110. )
  111. endfunction(copy_yuzu_Qt5_deps)