summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar James Rowe2015-03-26 04:00:49 -0600
committerGravatar James Rowe2015-03-26 04:04:24 -0600
commit5b9a5493c5151fe326b495c944687fc690598ef5 (patch)
tree147a67ec72c914a4e6bb5a9d6f004cbcf55f64d7
parentChanges to bring the previous commits in line with the comments on thepull re... (diff)
downloadyuzu-5b9a5493c5151fe326b495c944687fc690598ef5.tar.gz
yuzu-5b9a5493c5151fe326b495c944687fc690598ef5.tar.xz
yuzu-5b9a5493c5151fe326b495c944687fc690598ef5.zip
Updated the copy commands to run on post_build and use generator expressions to simplify the code as well
-rw-r--r--CMakeLists.txt16
-rw-r--r--src/citra_qt/CMakeLists.txt53
2 files changed, 34 insertions, 35 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64907a271..5cae66dec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,29 +12,29 @@ 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) 15 set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo CACHE STRING "" FORCE)
16 16
17 # Tweak optimization settings 17 # Tweak optimization settings
18 # 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
19 # changes intact, so we'll just clobber everything and say sorry. 19 # changes intact, so we'll just clobber everything and say sorry.
20 message(STATUS "Cache compiler flags ignored, please edit CMakeLists.txt to change the flags.") 20 message(STATUS "Cache compiler flags ignored, please edit CMakeLists.txt to change the flags.")
21 # /MP - Multi-threaded compilation 21 # /O2 - Optimization level 2
22 # /Ox - Full optimization
23 # /Oy- - Don't omit frame pointer 22 # /Oy- - Don't omit frame pointer
24 # /GR- - Disable RTTI 23 # /GR- - Disable RTTI
25 # /GS- - No stack buffer overflow checks 24 # /GS- - No stack buffer overflow checks
26 # /EHsc - C++-only exception handling semantics 25 # /EHsc - C++-only exception handling semantics
27 set(optimization_flags "/MP /Ox /Oy- /GR- /GS- /EHsc") 26 set(optimization_flags "/O2 /Oy- /GR- /GS- /EHsc")
27 # /MP - Multi-threaded compilation
28 # /Zi - Output debugging information 28 # /Zi - Output debugging information
29 # /Zo - enahnced debug info for optimized builds 29 # /Zo - enahnced debug info for optimized builds
30 # /MDd - Multi-threaded Debug Runtime DLL 30 # /MDd - Multi-threaded Debug Runtime DLL
31 set(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE) 31 set(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE)
32 set(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE) 32 set(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE)
33 # /MD - Multi-threaded runtime DLL 33 # /MD - Multi-threaded runtime DLL
34 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /MD" CACHE STRING "" FORCE) 34 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /MP /MD" CACHE STRING "" FORCE)
35 set(CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /MD" CACHE STRING "" FORCE) 35 set(CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /MP /MD" CACHE STRING "" FORCE)
36 set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /MD /Zi /Zo" CACHE STRING "" FORCE) 36 set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /MP /MD /Zi /Zo" CACHE STRING "" FORCE)
37 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /MD /Zi /Zo" CACHE STRING "" FORCE) 37 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /MP /MD /Zi /Zo" CACHE STRING "" FORCE)
38 38
39 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "" FORCE) 39 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "" FORCE)
40 set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG" CACHE STRING "" FORCE) 40 set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG" CACHE STRING "" FORCE)
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index 23513d7e2..2545b5d6a 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -77,34 +77,33 @@ target_link_libraries(citra-qt ${PLATFORM_LIBRARIES})
77 77
78if (Qt5_FOUND AND MSVC) 78if (Qt5_FOUND AND MSVC)
79 set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin") 79 set(Qt5_DLL_DIR "${Qt5_DIR}/../../../bin")
80 file(GLOB Qt5_DEBUG_DLLS 80 set(Qt5_PLATFORMS_DIR "${Qt5_DIR}/../../../plugins/platforms/")
81 "${Qt5_DLL_DIR}/icudt*.dll" 81 set(Qt5_DLLS
82 "${Qt5_DLL_DIR}/icuin*.dll" 82 icudt*.dll
83 "${Qt5_DLL_DIR}/icuuc*.dll" 83 icuin*.dll
84 "${Qt5_DLL_DIR}/Qt5Cored.*" 84 icuuc*.dll
85 "${Qt5_DLL_DIR}/Qt5Guid.*" 85 Qt5Core$<$<CONFIG:Debug>:d>.*
86 "${Qt5_DLL_DIR}/Qt5OpenGLd.*" 86 Qt5Gui$<$<CONFIG:Debug>:d>.*
87 "${Qt5_DLL_DIR}/Qt5Widgetsd.*" 87 Qt5OpenGL$<$<CONFIG:Debug>:d>.*
88 Qt5Widgets$<$<CONFIG:Debug>:d>.*
88 ) 89 )
89 file(GLOB Qt5_RELEASE_DLLS 90 set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/")
90 "${Qt5_DLL_DIR}/icudt*.dll" 91 set(PLATFORMS ${DLL_DEST}platforms/)
91 "${Qt5_DLL_DIR}/icuin*.dll" 92
92 "${Qt5_DLL_DIR}/icuuc*.dll" 93 # windows commandline expects the / to be \ so switch them
93 "${Qt5_DLL_DIR}/Qt5Core.*" 94 string(REPLACE "/" "\\" Qt5_DLL_DIR ${Qt5_DLL_DIR})
94 "${Qt5_DLL_DIR}/Qt5Gui.*" 95 string(REPLACE "/" "\\" Qt5_PLATFORMS_DIR ${Qt5_PLATFORMS_DIR})
95 "${Qt5_DLL_DIR}/Qt5OpenGL.*" 96 string(REPLACE "/" "\\" DLL_DEST ${DLL_DEST})
96 "${Qt5_DLL_DIR}/Qt5Widgets.*" 97 string(REPLACE "/" "\\" PLATFORMS ${PLATFORMS})
98
99 # /NJH /NJS /NDL /NFL /NC /NS /NP - Silence any output
100 # cmake adds an extra check for command success which doesn't work too well with robocopy
101 # so trick it into thinking the command was successful with the || cmd /c "exit /b 0"
102 add_custom_command(TARGET citra-qt POST_BUILD
103 COMMAND robocopy ${Qt5_DLL_DIR} ${DLL_DEST} ${Qt5_DLLS} /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
104 COMMAND if not exist ${PLATFORMS} mkdir ${PLATFORMS} 2> nul
105 COMMAND robocopy ${Qt5_PLATFORMS_DIR} ${PLATFORMS} qwindows$<$<CONFIG:Debug>:d>.* /NJH /NJS /NDL /NFL /NC /NS /NP || cmd /c "exit /b 0"
97 ) 106 )
98 # make the output directories ahead of the time and copy in the needed Dlls now 107 unset(Qt5_DLLS)
99 file(MAKE_DIRECTORY
100 ${CMAKE_BINARY_DIR}/bin/Debug/
101 ${CMAKE_BINARY_DIR}/bin/Release/
102 ${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/
103 )
104 file(COPY ${Qt5_DEBUG_DLLS} DESTINATION ${CMAKE_BINARY_DIR}/bin/Debug/)
105 file(COPY ${Qt5_RELEASE_DLLS} DESTINATION ${CMAKE_BINARY_DIR}/bin/Release/)
106 file(COPY ${Qt5_RELEASE_DLLS} DESTINATION ${CMAKE_BINARY_DIR}/bin/RelWithDebInfo/)
107 unset(Qt5_RELEASE_DLLS)
108 unset(Qt5_DEBUG_DLLS)
109 unset(Qt5_DLL_DIR) 108 unset(Qt5_DLL_DIR)
110endif() 109endif()