branch | ui-scaling |
changeset 15288 | c4fd2813b127 |
parent 14964 | 5cd4edd71d22 |
child 15454 | 6e09555b25b4 |
13395:0135e64c6c66 | 15288:c4fd2813b127 |
---|---|
42 foreach(l ${serverlocs}) |
42 foreach(l ${serverlocs}) |
43 list(APPEND locsout ${l} ",\n") |
43 list(APPEND locsout ${l} ",\n") |
44 endforeach(l) |
44 endforeach(l) |
45 list(APPEND locsout ${firstline} "\n}\\;\n") |
45 list(APPEND locsout ${firstline} "\n}\\;\n") |
46 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h ${locsout}) |
46 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h ${locsout}) |
47 |
|
48 |
|
49 # Credits localization |
|
50 file(GLOB CreditsCSV ${CMAKE_SOURCE_DIR}/QTfrontend/res/credits.csv) |
|
51 foreach(csvfile ${CreditsCSV}) |
|
52 # Load credits.csv |
|
53 file(READ ${csvfile} csv) |
|
54 |
|
55 # Match first line of CSV file |
|
56 string(REGEX MATCH "(E|S|U),\"[^\n\"]+\"" loc_top ${csv}) |
|
57 string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "\nQT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${loc_top}) |
|
58 list(APPEND csvlocs ${s}) |
|
59 |
|
60 # Match remaining lines of CSV file |
|
61 string(REGEX MATCHALL "\n(E|S|U),\"[^\n\"]+\"" locs ${csv}) |
|
62 foreach(str ${locs}) |
|
63 string(REGEX REPLACE "(E|S|U),\"([^\n\"]+)\"" "QT_TRANSLATE_NOOP(\"credits\", \"\\2\")" s ${str}) |
|
64 list(APPEND csvlocs ${s}) |
|
65 endforeach(str) |
|
66 endforeach(csvfile) |
|
67 |
|
68 list(REMOVE_DUPLICATES csvlocs) |
|
69 list(GET csvlocs 0 firstline) |
|
70 list(REMOVE_AT csvlocs 0) |
|
71 set(locsout "const char * creditsMessages[] = {") |
|
72 foreach(l ${csvlocs}) |
|
73 list(APPEND locsout ${l} ",") |
|
74 endforeach(l) |
|
75 list(APPEND locsout ${firstline} "\n}\\;\n") |
|
76 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/creditsmessages.h ${locsout}) |
|
77 |
|
47 |
78 |
48 include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
79 include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
49 include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
80 include_directories(${CMAKE_CURRENT_SOURCE_DIR}) |
50 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/model) |
81 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/model) |
51 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/net) |
82 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/net) |
90 HWApplication.cpp |
121 HWApplication.cpp |
91 hwform.cpp |
122 hwform.cpp |
92 main.cpp |
123 main.cpp |
93 team.cpp |
124 team.cpp |
94 campaign.cpp |
125 campaign.cpp |
126 mission.cpp |
|
95 ui_hwform.cpp |
127 ui_hwform.cpp |
96 ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
128 ${CMAKE_CURRENT_BINARY_DIR}/hwconsts.cpp |
129 ${CMAKE_CURRENT_SOURCE_DIR}/sdlkeys.cpp |
|
97 ) |
130 ) |
98 |
131 |
99 if(MINGW) |
132 if(MINGW) |
100 # resource compilation for mingw |
133 # resource compilation for mingw |
101 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
134 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hedgewars_rc.o |
134 binds.h |
167 binds.h |
135 ui_hwform.h |
168 ui_hwform.h |
136 hwconsts.h |
169 hwconsts.h |
137 sdlkeys.h |
170 sdlkeys.h |
138 campaign.h |
171 campaign.h |
172 mission.h |
|
139 ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h |
173 ${CMAKE_CURRENT_BINARY_DIR}/servermessages.h |
174 ${CMAKE_CURRENT_BINARY_DIR}/creditsmessages.h |
|
140 ) |
175 ) |
141 |
176 |
142 set(hwfr_rez hedgewars.qrc) |
177 set(hwfr_rez hedgewars.qrc) |
143 |
178 |
144 if(BUILD_ENGINE_LIBRARY) |
179 if(BUILD_ENGINE_LIBRARY) |
212 ) |
247 ) |
213 endif() |
248 endif() |
214 |
249 |
215 if(CMAKE_CXX_COMPILER MATCHES "clang*") |
250 if(CMAKE_CXX_COMPILER MATCHES "clang*") |
216 list(APPEND HW_LINK_LIBS stdc++ m) |
251 list(APPEND HW_LINK_LIBS stdc++ m) |
252 if(NOT APPLE) |
|
253 list(APPEND HW_LINK_LIBS atomic) |
|
254 endif() |
|
255 endif() |
|
256 |
|
257 if(WIN32 AND VCPKG_TOOLCHAIN) |
|
258 list(APPEND HW_LINK_LIBS Qt5::WinMain) |
|
217 endif() |
259 endif() |
218 |
260 |
219 target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
261 target_link_libraries(hedgewars ${HW_LINK_LIBS}) |
220 |
262 |
221 |
263 |