diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/citra_qt/CMakeLists.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index ff780cad4..be1de3341 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt | |||
| @@ -74,3 +74,47 @@ target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) | |||
| 74 | target_link_libraries(citra-qt ${PLATFORM_LIBRARIES}) | 74 | target_link_libraries(citra-qt ${PLATFORM_LIBRARIES}) |
| 75 | 75 | ||
| 76 | #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) | 76 | #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) |
| 77 | |||
| 78 | # setup a post build to copy the Qt Dlls to the right place on Windows MSVC | ||
| 79 | # I only have Qt 5 so if someone wants to add this for Qt 4 as well that would be great | ||
| 80 | if (Qt5_FOUND) | ||
| 81 | set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin") | ||
| 82 | file(GLOB Qt5_DEBUG_DLLS | ||
| 83 | "${Qt5_DLL_DIR}/icudt*.dll" | ||
| 84 | "${Qt5_DLL_DIR}/icuin*.dll" | ||
| 85 | "${Qt5_DLL_DIR}/icuuc*.dll" | ||
| 86 | "${Qt5_DLL_DIR}/Qt5Cored.*" | ||
| 87 | "${Qt5_DLL_DIR}/Qt5Guid.*" | ||
| 88 | "${Qt5_DLL_DIR}/Qt5OpenGLd.*" | ||
| 89 | "${Qt5_DLL_DIR}/Qt5Widgetsd.*" | ||
| 90 | ) | ||
| 91 | foreach(Dll ${Qt5_DEBUG_DLLS}) | ||
| 92 | # the if not exist skips this copy if the build directory doesn't exist so it doesn't error out | ||
| 93 | add_custom_command(TARGET citra-qt POST_BUILD | ||
| 94 | COMMAND if not exist "${CMAKE_BINARY_DIR}/bin/Debug/" goto :cmEnd | ||
| 95 | COMMAND ${CMAKE_COMMAND} -E | ||
| 96 | copy ${Dll} "${CMAKE_BINARY_DIR}/bin/Debug/") | ||
| 97 | endforeach() | ||
| 98 | # sooo here's a fun struggle. I can't set a custom command for a single build target, | ||
| 99 | # so instead I have to add all these to every configuration in VS anyway. | ||
| 100 | file(GLOB Qt5_RELEASE_DLLS | ||
| 101 | "${Qt5_DLL_DIR}/icudt*.dll" | ||
| 102 | "${Qt5_DLL_DIR}/icuin*.dll" | ||
| 103 | "${Qt5_DLL_DIR}/icuuc*.dll" | ||
| 104 | "${Qt5_DLL_DIR}/Qt5Core.*" | ||
| 105 | "${Qt5_DLL_DIR}/Qt5Gui.*" | ||
| 106 | "${Qt5_DLL_DIR}/Qt5OpenGL.*" | ||
| 107 | "${Qt5_DLL_DIR}/Qt5Widgets.*" | ||
| 108 | ) | ||
| 109 | foreach(Dll ${Qt5_RELEASE_DLLS}) | ||
| 110 | add_custom_command(TARGET citra-qt POST_BUILD | ||
| 111 | COMMAND if not exist "${CMAKE_BINARY_DIR}/bin/Release/" goto :cmEnd | ||
| 112 | COMMAND ${CMAKE_COMMAND} -E | ||
| 113 | copy ${Dll} "${CMAKE_BINARY_DIR}/bin/Release/") | ||
| 114 | add_custom_command(TARGET citra-qt POST_BUILD | ||
| 115 | COMMAND if not exist "${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/" goto :cmEnd | ||
| 116 | COMMAND ${CMAKE_COMMAND} -E | ||
| 117 | copy ${Dll} "${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/") | ||
| 118 | endforeach() | ||
| 119 | unset(Qt5_DLL_DIR) | ||
| 120 | endif() | ||