forked from mapsme/omim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
324 lines (295 loc) · 7.92 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
project(desktop)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
QT5_ADD_RESOURCES(RES_SOURCES res/resources.qrc)
set_property(SOURCE qrc_resources.cpp PROPERTY SKIP_AUTOGEN ON)
include_directories(
${OMIM_ROOT}/3party/glm
${OMIM_ROOT}/3party/gflags/src
${OMIM_ROOT}/3party/jansson/src
)
set(
SRC
about.cpp
about.hpp
bookmark_dialog.cpp
bookmark_dialog.hpp
build_style/build_common.cpp
build_style/build_common.h
build_style/build_drules.cpp
build_style/build_drules.h
build_style/build_phone_pack.cpp
build_style/build_phone_pack.h
build_style/build_skins.cpp
build_style/build_skins.h
build_style/build_statistics.cpp
build_style/build_statistics.h
build_style/build_style.cpp
build_style/build_style.h
build_style/run_tests.cpp
build_style/run_tests.h
create_feature_dialog.cpp
create_feature_dialog.hpp
draw_widget.cpp
draw_widget.hpp
editor_dialog.cpp
editor_dialog.hpp
info_dialog.cpp
info_dialog.hpp
main.cpp
mainwindow.cpp
mainwindow.hpp
mwms_borders_selection.cpp
mwms_borders_selection.hpp
osm_auth_dialog.cpp
osm_auth_dialog.hpp
place_page_dialog.cpp
place_page_dialog.hpp
preferences_dialog.cpp
preferences_dialog.hpp
routing_settings_dialog.cpp
routing_settings_dialog.hpp
routing_turns_visualizer.cpp
routing_turns_visualizer.hpp
ruler.cpp
ruler.hpp
screenshoter.cpp
screenshoter.hpp
search_panel.cpp
search_panel.hpp
update_dialog.cpp
update_dialog.hpp
)
omim_add_executable(${PROJECT_NAME} MACOSX_BUNDLE ${RES_SOURCES} ${SRC})
omim_link_libraries(
${PROJECT_NAME}
qt_common
map
ge0
drape_frontend
shaders
generator
routing
search
storage
mwm_diff
bsdiff
tracking
traffic
routing_common
transit
descriptions
ugc
drape
partners_api
web_api
local_ads
kml
editor
indexer
metrics
platform
geometry
coding
base
freetype
expat
gflags
icu
agg
jansson
protobuf
stats_client
minizip
succinct
pugixml
oauthcpp
opening_hours
stb_image
sdf_image
vulkan_wrapper
${Qt5Gui_LIBRARIES}
${Qt5Network_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${LIBZ}
)
if (PLATFORM_LINUX)
omim_link_libraries(
${PROJECT_NAME}
dl
)
endif()
link_opengl(${PROJECT_NAME})
link_qt5_core(${PROJECT_NAME})
if (BUILD_DESIGNER)
set(BUNDLE_NAME "MAPS.ME.Designer")
set(BUNDLE_DISPLAY_NAME "MAPS.ME Designer")
set(BUNDLE_ICON designer.icns)
else()
set(BUNDLE_NAME "MAPS.ME")
set(BUNDLE_DISPLAY_NAME "MAPS.ME Desktop")
set(BUNDLE_ICON mac.icns)
endif()
set_target_properties(
${PROJECT_NAME}
PROPERTIES
OUTPUT_NAME ${BUNDLE_NAME}
)
set(BUNDLE_EXECUTABLE ${BUNDLE_NAME})
set(BUNDLE_FOLDER ${CMAKE_BINARY_DIR}/${BUNDLE_NAME}.app)
set(RESOURCES_FOLDER ${BUNDLE_FOLDER}/Contents/Resources)
set(DATA_DIR ${OMIM_ROOT}/data)
execute_process(
COMMAND mkdir -p ${RESOURCES_FOLDER}/shaders_compiler
COMMAND cp ${PROJECT_SOURCE_DIR}/res/mac.icns ${RESOURCES_FOLDER}
COMMAND cp ${PROJECT_SOURCE_DIR}/res/designer.icns ${RESOURCES_FOLDER}
)
function(copy_resources)
foreach(file ${ARGN})
execute_process(
COMMAND cp -r ${DATA_DIR}/${file} ${RESOURCES_FOLDER}
)
endforeach()
endfunction()
copy_resources(
countries-strings
resources-default
resources-mdpi_clear
resources-hdpi_clear
resources-xhdpi_clear
resources-xxhdpi_clear
resources-xxxhdpi_clear
resources-6plus_clear
taxi_places
eula.html
categories.txt
categories_cuisines.txt
classificator.txt
colors.txt
copyright.html
countries.txt
drules_proto_clear.bin
drules_proto_dark.bin
drules_proto_vehicle_clear.bin
drules_proto_vehicle_dark.bin
editor.config
fonts_blacklist.txt
fonts_whitelist.txt
packed_polygons.bin
patterns.txt
transit_colors.txt
types.txt
unicode_blocks.txt
World.mwm
WorldCoasts.mwm
icudt57l.dat
local_ads_symbols.txt
01_dejavusans.ttf
02_droidsans-fallback.ttf
03_jomolhari-id-a3d.ttf
04_padauk.ttf
05_khmeros.ttf
06_code2000.ttf
07_roboto_medium.ttf
)
if (PLATFORM_MAC)
execute_process(
COMMAND cp -r ${OMIM_ROOT}/tools/shaders_compiler/macos ${RESOURCES_FOLDER}/shaders_compiler
)
elseif(PLATFORM_LINUX)
execute_process(
COMMAND cp -r ${OMIM_ROOT}/tools/shaders_compiler/linux ${RESOURCES_FOLDER}/shaders_compiler
)
endif()
if (PLATFORM_MAC)
target_link_libraries(
${PROJECT_NAME}
"-framework Foundation"
"-framework CoreLocation"
"-framework CoreWLAN"
"-framework SystemConfiguration"
"-framework CFNetwork"
)
if (NOT APP_VERSION)
set(BUNDLE_VERSION "UNKNOWN")
else()
set(BUNDLE_VERSION ${APP_VERSION})
endif()
configure_file(${PROJECT_SOURCE_DIR}/res/Info.plist.in ${PROJECT_SOURCE_DIR}/res/Info.plist)
set_target_properties(
${PROJECT_NAME}
PROPERTIES
OUTPUT_NAME ${BUNDLE_NAME}
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/res/Info.plist
)
endif()
if (BUILD_DESIGNER)
execute_process(
COMMAND cp -rf ${OMIM_ROOT}/data/resources-mdpi_clear/ ${OMIM_ROOT}/data/resources-mdpi_design/
COMMAND cp -rf ${OMIM_ROOT}/data/resources-hdpi_clear/ ${OMIM_ROOT}/data/resources-hdpi_design/
COMMAND cp -rf ${OMIM_ROOT}/data/resources-xhdpi_clear/ ${OMIM_ROOT}/data/resources-xhdpi_design/
COMMAND cp -rf ${OMIM_ROOT}/data/resources-xxhdpi_clear/ ${OMIM_ROOT}/data/resources-xxhdpi_design/
COMMAND cp -rf ${OMIM_ROOT}/data/resources-6plus_clear/ ${OMIM_ROOT}/data/resources-6plus_design/
COMMAND cp -rf ${OMIM_ROOT}/data/resources-xxxhdpi_clear/ ${OMIM_ROOT}/data/resources-xxxhdpi_design/
COMMAND cp -f ${OMIM_ROOT}/data/drules_proto_clear.bin ${OMIM_ROOT}/data/drules_proto_design.bin
COMMAND cp -f ${OMIM_ROOT}/data/colors.txt ${OMIM_ROOT}/data/colors_design.txt
COMMAND cp -f ${OMIM_ROOT}/data/patterns.txt ${OMIM_ROOT}/data/patterns_design.txt
)
copy_resources(
colors_design.txt
drules_proto_design.bin
mapcss-dynamic.txt
mapcss-mapping.csv
patterns_design.txt
resources-mdpi_design
resources-hdpi_design
resources-xhdpi_design
resources-xxhdpi_design
resources-xxxhdpi_design
resources-6plus_design
)
execute_process(
COMMAND cp ${OMIM_ROOT}/tools/python/recalculate_geom_index.py ${RESOURCES_FOLDER}
COMMAND cp ${OMIM_ROOT}/tools/python/generate_styles_override.py ${RESOURCES_FOLDER}
COMMAND cp -rf ${OMIM_ROOT}/tools/kothic ${RESOURCES_FOLDER}/kothic/
COMMAND cp -f ${OMIM_ROOT}/tools/python/stylesheet/drules_info.py ${RESOURCES_FOLDER}/kothic/src/
COMMAND cp -rf ${OMIM_ROOT}/tools/python/stylesheet/ ${RESOURCES_FOLDER}/kothic/src/
COMMAND cp -f ${OMIM_ROOT}/3party/protobuf/protobuf-3.3.0-py2.7.egg ${RESOURCES_FOLDER}/kothic/
)
# Generate DMG
install(DIRECTORY ${DATA_DIR}/styles DESTINATION .)
set(
BUNDLES
${CMAKE_BINARY_DIR}/generator_tool.app
${CMAKE_BINARY_DIR}/skin_generator_tool.app
${CMAKE_BINARY_DIR}/style_tests.app
)
install(CODE "
foreach(BUNDLE ${BUNDLE_FOLDER} ${BUNDLES})
execute_process(
COMMAND \"${QT_PATH}/bin/macdeployqt\" \"\${BUNDLE}\"
COMMAND find \"\${BUNDLE}/Contents/MacOS\" -type f -exec python \"${OMIM_ROOT}/tools/macdeployqtfix/macdeployqtfix.py\" -q -nl {} \"${QT_PATH}\" \\;
)
endforeach()
foreach(BUNDLE ${BUNDLES})
execute_process(
COMMAND cp -rf \"\${BUNDLE}\" \"${RESOURCES_FOLDER}\"
)
endforeach()
")
install(TARGETS ${PROJECT_NAME} DESTINATION .)
set(CPACK_GENERATOR DragNDrop)
set(CPACK_DMG_FORMAT UDZO)
set(CPACK_DMG_VOLUME_NAME ${BUNDLE_NAME})
set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/res/designer.icns)
include(CPack)
elseif (BUILD_STANDALONE)
add_custom_command(TARGET desktop POST_BUILD
COMMAND "${QT_PATH}/bin/macdeployqt" ${BUNDLE_FOLDER}
COMMAND ${PYTHON_EXECUTABLE} "${OMIM_ROOT}/tools/macdeployqtfix/macdeployqtfix.py" -q -nl ${BUNDLE_FOLDER}/Contents/MacOS/${BUNDLE_NAME} ${QT_PATH}
COMMAND echo "Fixing Qt dependencies finished."
VERBATIM
COMMENT "Fixing Qt dependencies for standalone desktop app"
)
endif()
add_subdirectory(qt_common)