summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar James Rowe2015-02-26 20:24:22 -0700
committerGravatar James Rowe2015-03-26 04:04:23 -0600
commit2d7008f03c15e983c76f91ef95b1361fa3313762 (patch)
tree701c67c203c814ee543a7d5a6bb289f1ffdbf203
parentMore changes to the CMakeFiles for better MSVC compatibility. Added in the Re... (diff)
downloadyuzu-2d7008f03c15e983c76f91ef95b1361fa3313762.tar.gz
yuzu-2d7008f03c15e983c76f91ef95b1361fa3313762.tar.xz
yuzu-2d7008f03c15e983c76f91ef95b1361fa3313762.zip
Changes to bring the previous commits in line with the comments on thepull request. Made the debug build a true debug build with no optimizxations and the RelWithDebInfo is what it says it is too. Changed the copying of the dlls to the build directories to happen at configuration time instead of build time
-rw-r--r--CMakeLists.txt11
-rw-r--r--src/citra_qt/CMakeLists.txt34
2 files changed, 18 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbfef2811..64907a271 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,8 @@ else()
12 add_definitions(/D_CRT_SECURE_NO_WARNINGS) 12 add_definitions(/D_CRT_SECURE_NO_WARNINGS)
13 # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) 13 # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms)
14 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) 14 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
15 set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo CACHE TYPE INTERNAL FORCE) 15 set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo CACHE TYPE INTERNAL)
16
16 # Tweak optimization settings 17 # Tweak optimization settings
17 # As far as I can tell, there's no way to override the CMake defaults while leaving user 18 # As far as I can tell, there's no way to override the CMake defaults while leaving user
18 # changes intact, so we'll just clobber everything and say sorry. 19 # changes intact, so we'll just clobber everything and say sorry.
@@ -27,11 +28,11 @@ else()
27 # /Zi - Output debugging information 28 # /Zi - Output debugging information
28 # /Zo - enahnced debug info for optimized builds 29 # /Zo - enahnced debug info for optimized builds
29 # /MDd - Multi-threaded Debug Runtime DLL 30 # /MDd - Multi-threaded Debug Runtime DLL
30 set(CMAKE_C_FLAGS_DEBUG "${optimization_flags} /MDd /Zi /Zo" CACHE STRING "" FORCE) 31 set(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE)
31 set(CMAKE_CXX_FLAGS_DEBUG "${optimization_flags} /MDd /Zi /Zo" CACHE STRING "" FORCE) 32 set(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE)
32 # /MD - Multi-threaded runtime DLL 33 # /MD - Multi-threaded runtime DLL
33 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /MD /Zi" CACHE STRING "" FORCE) 34 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /MD" CACHE STRING "" FORCE)
34 set(CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /MD /Zi" CACHE STRING "" FORCE) 35 set(CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /MD" CACHE STRING "" FORCE)
35 set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /MD /Zi /Zo" CACHE STRING "" FORCE) 36 set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /MD /Zi /Zo" CACHE STRING "" FORCE)
36 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /MD /Zi /Zo" CACHE STRING "" FORCE) 37 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /MD /Zi /Zo" CACHE STRING "" FORCE)
37 38
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()