-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
214 lines (168 loc) · 5.01 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
cmake_minimum_required(VERSION 3.5)
project(Generals.OI VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include_directories(
src
src/geometry
src/point
src/gameMap
src/gameMap/basicMap
src/gameMap/clientMap
src/gameMap/serverMap
src/gameMap/mapGenerator
src/gameWindow/surrenderWindow
src/gameWindow/endWindow
src/gameWindow
src/gameWindow/gameButton
src/gameInformation
src/server
src/server/recorder
src/startWindow
src/startWindow/teamButton
src/windowFrame/titleBar
src/server/serverSettingsWindow
src/windowFrame
src/processJson
res
res/aud
res/font
res/img
res/qss
)
find_package(
QT NAMES
Qt5
Qt6
REQUIRED COMPONENTS
Core
Gui
Widgets
WebSockets
Multimedia
)
find_package(
Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS
Core
Gui
Widgets
WebSockets
Multimedia
)
message("Current Qt version: " ${QT_VERSION_MAJOR})
message("Current build type: " ${CMAKE_BUILD_TYPE})
set(
PROJECT_SOURCES
src/main.cpp
src/gameWindow/focus.cpp
src/gameWindow/gameWindow.cpp
src/gameWindow/boardLabel.cpp
src/gameWindow/highlighter.cpp
src/gameWindow/moveInfo.cpp
src/gameWindow/gameWindow.h
src/gameWindow/surrenderWindow/surrenderWindow.cpp
src/gameWindow/surrenderWindow/surrenderWindow.h
src/gameWindow/surrenderWindow/surrenderWindow.ui
src/gameWindow/endWindow/endWindow.cpp
src/gameWindow/endWindow/endWindow.h
src/gameWindow/endWindow/endWindow.ui
src/gameWindow/gameButton/gameButton.cpp
src/gameWindow/gameButton/gameButton.h
src/startWindow/startWindow.cpp
src/startWindow/startWindow.h
src/startWindow/startWindow.ui
src/startWindow/teamButton/teamButton.cpp
src/startWindow/teamButton/teamButton.h
src/server/server.cpp
src/server/server.h
src/server/recorder/recorder.cpp
src/server/recorder/recorder.h
src/server/serverSettingsWindow/serverSettingsWindow.cpp
src/server/serverSettingsWindow/serverSettingsWindow.h
src/server/serverSettingsWindow/serverSettingsWindow.ui
src/windowFrame/windowFrame.cpp
src/windowFrame/windowFrame.h
src/windowFrame/titleBar/titleBar.cpp
src/windowFrame/titleBar/titleBar.h
src/processJson/processJson.h
src/gameInformation/gameInformation.cpp
src/gameInformation/gameInformation.h
src/point/point.cpp
src/point/point.h
src/gameMap/serverMap/serverMap.cpp
src/gameMap/serverMap/serverMap.h
src/gameMap/clientMap/clientMap.cpp
src/gameMap/clientMap/clientMap.h
src/gameMap/basicMap/basicMap.cpp
src/gameMap/basicMap/basicMap.h
src/gameMap/mapGenerator/mapGenerator.cpp
src/gameMap/mapGenerator/mapGenerator.h
src/geometry/geometry.cpp
src/geometry/geometry.h
)
set(
PROJECT_RESOURCES
res/generals.qrc
res/generals.rc)
if (${QT_VERSION_MAJOR} GREATER_EQUAL 5)
add_executable(
Generals.OI
${PROJECT_SOURCES}
${PROJECT_RESOURCES}
)
endif ()
add_executable(
Test-Generate
src/test-generate.cpp
src/point/point.cpp
src/point/point.h
src/gameMap/basicMap/basicMap.cpp
src/gameMap/basicMap/basicMap.h
src/gameMap/serverMap/serverMap.cpp
src/gameMap/serverMap/serverMap.h
src/gameMap/clientMap/clientMap.cpp
src/gameMap/clientMap/clientMap.h
src/gameMap/mapGenerator/mapGenerator.cpp
src/gameMap/mapGenerator/mapGenerator.h
src/geometry/geometry.cpp
src/geometry/geometry.h
)
add_executable(
Test-Recorder
src/test-recorder.cpp
src/server/recorder/recorder.cpp
src/server/recorder/recorder.h
)
target_link_libraries(
Generals.OI PRIVATE
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Gui
Qt${QT_VERSION_MAJOR}::Widgets
Qt${QT_VERSION_MAJOR}::WebSockets
Qt${QT_VERSION_MAJOR}::Multimedia
)
target_link_libraries(
Test-Generate PRIVATE
Qt${QT_VERSION_MAJOR}::Core
)
target_link_libraries(
Test-Recorder PRIVATE
Qt${QT_VERSION_MAJOR}::Core
)
if (CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
set_target_properties(
Generals.OI PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
)
endif ()
install(
TARGETS Generals.OI
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)