summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/CMakeLists.txt34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index be1de3341..23513d7e2 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -75,9 +75,7 @@ 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 77
78# setup a post build to copy the Qt Dlls to the right place on Windows MSVC 78if (Qt5_FOUND AND MSVC)
79# I only have Qt 5 so if someone wants to add this for Qt 4 as well that would be great
80if (Qt5_FOUND)
81 set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin") 79 set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
82 file(GLOB Qt5_DEBUG_DLLS 80 file(GLOB Qt5_DEBUG_DLLS
83 "${Qt5_DLL_DIR}/icudt*.dll" 81 "${Qt5_DLL_DIR}/icudt*.dll"
@@ -88,15 +86,6 @@ if (Qt5_FOUND)
88 "${Qt5_DLL_DIR}/Qt5OpenGLd.*" 86 "${Qt5_DLL_DIR}/Qt5OpenGLd.*"
89 "${Qt5_DLL_DIR}/Qt5Widgetsd.*" 87 "${Qt5_DLL_DIR}/Qt5Widgetsd.*"
90 ) 88 )
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 89 file(GLOB Qt5_RELEASE_DLLS
101 "${Qt5_DLL_DIR}/icudt*.dll" 90 "${Qt5_DLL_DIR}/icudt*.dll"
102 "${Qt5_DLL_DIR}/icuin*.dll" 91 "${Qt5_DLL_DIR}/icuin*.dll"
@@ -106,15 +95,16 @@ if (Qt5_FOUND)
106 "${Qt5_DLL_DIR}/Qt5OpenGL.*" 95 "${Qt5_DLL_DIR}/Qt5OpenGL.*"
107 "${Qt5_DLL_DIR}/Qt5Widgets.*" 96 "${Qt5_DLL_DIR}/Qt5Widgets.*"
108 ) 97 )
109 foreach(Dll ${Qt5_RELEASE_DLLS}) 98 # make the output directories ahead of the time and copy in the needed Dlls now
110 add_custom_command(TARGET citra-qt POST_BUILD 99 file(MAKE_DIRECTORY
111 COMMAND if not exist "${CMAKE_BINARY_DIR}/bin/Release/" goto :cmEnd 100 ${CMAKE_BINARY_DIR}/bin/Debug/
112 COMMAND ${CMAKE_COMMAND} -E 101 ${CMAKE_BINARY_DIR}/bin/Release/
113 copy ${Dll} "${CMAKE_BINARY_DIR}/bin/Release/") 102 ${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/
114 add_custom_command(TARGET citra-qt POST_BUILD 103 )
115 COMMAND if not exist "${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/" goto :cmEnd 104 file(COPY ${Qt5_DEBUG_DLLS} DESTINATION ${CMAKE_BINARY_DIR}/bin/Debug/)
116 COMMAND ${CMAKE_COMMAND} -E 105 file(COPY ${Qt5_RELEASE_DLLS} DESTINATION ${CMAKE_BINARY_DIR}/bin/Release/)
117 copy ${Dll} "${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/") 106 file(COPY ${Qt5_RELEASE_DLLS} DESTINATION ${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/)
118 endforeach() 107 unset(Qt5_RELEASE_DLLS)
108 unset(Qt5_DEBUG_DLLS)
119 unset(Qt5_DLL_DIR) 109 unset(Qt5_DLL_DIR)
120endif() 110endif()