-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
CMakeLists.txt
304 lines (235 loc) · 9.58 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
cmake_minimum_required(VERSION 2.8...3.22)
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
message(FATAL_ERROR "In-source builds not allowed.
Please make a new directory (called a build directory) and run CMake from there.
You may need to remove CMakeCache.txt." )
endif()
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
project(PGR_WORKSHOP LANGUAGES NONE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
# Setting the version number
#---------------------------------------------
set(WORKSHOP_AREA "FOSS4G Prizren")
set(COPYRIGHT "2010-2023 pgRouting Developers")
set(PGR_WORKSHOP_VERSION_MAJOR "2")
set(PGR_WORKSHOP_VERSION_MINOR "9")
set(PGR_WORKSHOP_VERSION_PATCH "0")
set(PGR_WORKSHOP_VERSION_DEV "")
set(PGR_WORKSHOP_VERSION "${PGR_WORKSHOP_VERSION_MAJOR}.${PGR_WORKSHOP_VERSION_MINOR}")
set(PGR_WORKSHOP_RELEASE "${PGR_WORKSHOP_VERSION_MAJOR}.${PGR_WORKSHOP_VERSION_MINOR}.${PGR_WORKSHOP_VERSION_PATCH}${PGR_WORKSHOP_VERSION_DEV}")
set(PGR_WORKSHOP_NAME "pgRouting workshop")
set(PGR_HTML_TITLE "Workshop - FOSS4G 2023 Prizren - Routing with pgRouting")
set(PGR_HTML_SHORT_TITLE "Workshop - Prizren")
set(OSGeoLive_VERSION "16.0")
#---------------------------------------------
# setting debug options
#---------------------------------------------
option(PGR_WORKSHOP_DEBUG
"Set ON|OFF (default=OFF) to display basic DEBUG" OFF)
option(PGR_WORKSHOP_VERBOSE_DEBUG
"Set ON|OFF (default=OFF) to display detailed DEBUG" OFF)
#---------------------------------------------
#---------------------------------------------
# CONFIGURATION
#---------------------------------------------
set(PGR_WORKSHOP_CITY "Prizren")
set(PGR_WORKSHOP_CITY_FILE "Prizren_XK")
# https://github.com/OSGeo/OSGeoLive/blob/master/bin/install_osm.sh
# around line 117
set(PGR_WORKSHOP_CITY_BBOX "21.1922265,42.0816364,20.2206175,42.6653875")
# Make it smaller
set(PGR_WORKSHOP_LITTLE_NET_BBOX "20.73,42.20891,20.76,42.23")
# Use git blame to get the date when the line was changed
set(PGR_WORKSHOP_DOWNLOAD_DIR "workshop-2023")
set(DATE_OF_DATA "March 2023")
set(OSMID_1 "2385630446")
set(OSMID_2 "1838481592")
set(OSMID_3 "1840522495")
set(OSMID_4 "6917727056")
set(OSMID_5 "2385655026")
# osm_id IN (6917727056, 2385655026, 1838481592, 1840522495, 2385630446)
# 3->1: routes for vehicles with penalty & no penalty must be different
set(PLACE_1 "Nadir Xhemali Danijolli")
set(PLACE_2 "Qendra Sprotive")
set(PLACE_3 "Kalaja e Prizrenit")
set(PLACE_4 "Inovation and Training Park")
set(PLACE_5 "Lidhja Shqiptare e Prizrenit")
set(POINT1_LON "20.729354")
set(POINT1_LAT "42.2151")
set(POINT2_LON "20.7312")
set(POINT2_LAT "42.2147")
# by chapters
set(CH7_PLACE_1 ${PLACE_5})
set(CH7_PLACE_2 ${PLACE_1})
set(CH7_OSMID_1 ${OSMID_5})
set(CH7_OSMID_2 ${OSMID_1})
#---------------------------------------------
# minimum versions
#---------------------------------------------
set(SPHINX_MINIMUM_VERSION "2.3")
set(Osm2pgrouting_FIND_VERSION "2.3")
#---------------------------------------------
# Finding sphinx
#---------------------------------------------
find_package(Sphinx REQUIRED)
if (NOT SPHINX_FOUND)
message(FATAL_ERROR "Sphinx not found")
#elseif (SPHINX_VERSION VERSION_LESS SPHINX_MINIMUM_VERSION)
# message(WARNING "Your Sphinx version is too old!
# This project requires Sphinx v1.0 or above to produce
# proper documentation (you have v${SPHINX_VERSION}).
# You will get output but it will have errors.")
endif()
#---------------------------------------------
# Finding osm2pgRouting
#---------------------------------------------
find_package(Osm2pgrouting ${Osm2pgrouting_FIND_VERSION} REQUIRED
COMPONENTS mapconfig)
#---------------------------------------------
# Finding psql
#---------------------------------------------
find_package(PSQL)
message(STATUS "Found psql ${PSQL_EXECUTABLE}")
message(STATUS "Found createdb ${CREATEDB_EXECUTABLE}")
message(STATUS "Found dropdb ${DROPDB_EXECUTABLE}")
#---------------------------------------------
# Perl
#---------------------------------------------
#---------------------------------------------
include(FindPerl)
if(NOT PERL_EXECUTABLE)
message(FATAL_ERROR " Please check your Perl installation.")
endif(NOT PERL_EXECUTABLE)
execute_process(
COMMAND ${PERL_EXECUTABLE} -MDateTime -e ""
ERROR_QUIET RESULT_VARIABLE DATETIME_STAUS
)
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
# Kind of output
# http://www.sphinx-doc.org/en/stable/builders.html
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
option(ALL_DOC
"Set ON|OFF (default=OFF) to build all documentation styles (exept LOCALE)" OFF)
option(HTML
"Set ON|OFF (default=OFF) to build Documentation library tree as HTML" ON)
option(DIRHTML
"Set ON|OFF (default=OFF) to build Documentation library tree as DIRHTML
STATUS: the navigation does not work " OFF
)
option(SINGLEHTML
"Set ON|OFF (default=OFF) to build Documentation library tree as a single HTML file" OFF
)
option(PICKLE
"Set ON|OFF (default=OFF) to build Documentation library tree as PICKLE" OFF)
option(JSON
"Set ON|OFF (default=OFF) to build Documentation library tree as JSON page" OFF)
option(HTMLHELP
"Set ON|OFF (default=OFF) to build Documentation library tree as HTMLHELP page" OFF)
option(DUMMY
"Set ON|OFF (default=OFF) to build Documentation library tree as DUMMY page" OFF)
option(LATEX
"Set ON|OFF (default=OFF) to build Documentation library tree as LATEX page" OFF)
option(LINKCHECK
"Set ON|OFF (default=OFF) to build Documentation library tree as LINKCHECK page" OFF)
option(LOCALE
"Set ON|OFF (default=OFF) to build the locale files of all languages." OFF
)
foreach(opt HTML DIRHTML SINGLEHTML PICKLE JSON HTMLHELP LATEX LINKCHECK)
if (${${opt}} OR ALL_DOC)
string(TOLOWER ${opt} val)
list(APPEND PGR_WORKSHOP_DOC_TARGETS ${val})
endif()
endforeach()
message(STATUS "PGR_WORKSHOP_DOC_TARGETS = ${PGR_WORKSHOP_DOC_TARGETS}")
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
# LANGUAGES SETINGS
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
# Avaliable Languages
# English is allways built
# list of sphinx languges support
# http://www.sphinx-doc.org/en/stable/config.html#confval-language
# TODO: figure out how to support this
# "el" "hu" "id" "zh")
#---------------------------------------------
set(PGR_WORKSHOP_SUPPORTED_LANGUAGES "es")
set(PGR_WORKSHOP_ENGLISH "en")
#---------------------------------------------
# Language options
#---------------------------------------------
option(ALL_LANG
"Set ON|OFF (default=OFF) to build all documentation supported languages
${PGR_WORKSHOP_SUPPORTED_LANGUAGES}" OFF)
foreach(lang ${PGR_WORKSHOP_SUPPORTED_LANGUAGES})
string(TOUPPER ${lang} val)
option(${val}
"Set ON|OFF (default=OFF) build ${lang} Documentation" OFF)
endforeach()
#---------------------------------------------
# Catching the language options to be build
#---------------------------------------------
list(APPEND PGR_WORKSHOP_BUILD_LANGUAGES ${PGR_WORKSHOP_ENGLISH})
foreach(lang ${PGR_WORKSHOP_SUPPORTED_LANGUAGES})
string(TOUPPER ${lang} opt)
if (${opt} OR ALL_LANG)
list(APPEND PGR_WORKSHOP_BUILD_LANGUAGES ${lang})
endif()
endforeach()
#---------------------------------------------
# All languages po files are to be generated
#---------------------------------------------
set (SPHINXINTL_LANGUAGE ${PGR_WORKSHOP_ENGLISH})
if(LOCALE)
foreach(lang ${PGR_WORKSHOP_SUPPORTED_LANGUAGES})
set(SPHINXINTL_LANGUAGE "${SPHINXINTL_LANGUAGE},${lang}")
endforeach()
set(PGR_WORKSHOP_LANGUAGES ${PGR_WORKSHOP_ENGLISH})
endif()
#------------------------------------------
# Used to generate the languages bar
#------------------------------------------
MACRO(INSERT_INTO_MAP _KEY _VALUE)
SET("LangMap_${_KEY}" "${_VALUE}")
ENDMACRO(INSERT_INTO_MAP)
INSERT_INTO_MAP("ca" "Català")
INSERT_INTO_MAP("de" "Deutsch")
INSERT_INTO_MAP("el" "Ελληνικά")
INSERT_INTO_MAP("en" "English")
INSERT_INTO_MAP("es" "Español")
INSERT_INTO_MAP("fr" "Français")
INSERT_INTO_MAP("fi" "Suomen kieli")
INSERT_INTO_MAP("hu" "Hungarian")
INSERT_INTO_MAP("id" "Bahasa Indonesia")
INSERT_INTO_MAP("it" "Italiano")
INSERT_INTO_MAP("ja" "日本語")
INSERT_INTO_MAP("ko" "한국어")
INSERT_INTO_MAP("pl" "Polski")
INSERT_INTO_MAP("pt" "Portugus")
INSERT_INTO_MAP("ru" "Русский")
INSERT_INTO_MAP("zh" "中文")
message(STATUS "PGR_WORKSHOP_BUILD_LANGUAGES = ${PGR_WORKSHOP_BUILD_LANGUAGES}")
message(STATUS "SPHINXINTL_LANGUAGE = ${SPHINXINTL_LANGUAGE}")
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
# The list of projects to be documented
#---------------------------------------------
#---------------------------------------------
#---------------------------------------------
add_subdirectory(docs)