-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
423 lines (377 loc) · 15.4 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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
#############################################################
# sources
SET(QGIS_ANALYSIS_SRCS
qgsanalysis.cpp
interpolation/qgsgridfilewriter.cpp
interpolation/qgsidwinterpolator.cpp
interpolation/qgsinterpolator.cpp
interpolation/qgstininterpolator.cpp
interpolation/Bezier3D.cpp
interpolation/CloughTocherInterpolator.cpp
interpolation/DualEdgeTriangulation.cpp
interpolation/HalfEdge.cpp
interpolation/LinTriangleInterpolator.cpp
interpolation/MathUtils.cpp
interpolation/NormVecDecorator.cpp
interpolation/ParametricLine.cpp
interpolation/TriangleInterpolator.cpp
interpolation/Triangulation.cpp
interpolation/TriDecorator.cpp
interpolation/Vector3D.cpp
processing/qgsalgorithmaddincrementalfield.cpp
processing/qgsalgorithmarraytranslatedfeatures.cpp
processing/qgsalgorithmassignprojection.cpp
processing/qgsalgorithmboundary.cpp
processing/qgsalgorithmboundingbox.cpp
processing/qgsalgorithmbuffer.cpp
processing/qgsalgorithmcategorizeusingstyle.cpp
processing/qgsalgorithmcentroid.cpp
processing/qgsalgorithmclip.cpp
processing/qgsalgorithmconvexhull.cpp
processing/qgsalgorithmdbscanclustering.cpp
processing/qgsalgorithmdifference.cpp
processing/qgsalgorithmdissolve.cpp
processing/qgsalgorithmdrape.cpp
processing/qgsalgorithmdropgeometry.cpp
processing/qgsalgorithmdropmzvalues.cpp
processing/qgsalgorithmexplode.cpp
processing/qgsalgorithmextendlines.cpp
processing/qgsalgorithmextenttolayer.cpp
processing/qgsalgorithmextractbyattribute.cpp
processing/qgsalgorithmextractbyexpression.cpp
processing/qgsalgorithmextractbyextent.cpp
processing/qgsalgorithmextractbylocation.cpp
processing/qgsalgorithmextractvertices.cpp
processing/qgsalgorithmfiledownloader.cpp
processing/qgsalgorithmfilter.cpp
processing/qgsalgorithmfiltervertices.cpp
processing/qgsalgorithmfixgeometries.cpp
processing/qgsalgorithmimportphotos.cpp
processing/qgsalgorithminterpolatepoint.cpp
processing/qgsalgorithmintersection.cpp
processing/qgsalgorithmjoinbyattribute.cpp
processing/qgsalgorithmjoinwithlines.cpp
processing/qgsalgorithmkmeansclustering.cpp
processing/qgsalgorithmlineintersection.cpp
processing/qgsalgorithmlinesubstring.cpp
processing/qgsalgorithmloadlayer.cpp
processing/qgsalgorithmmeancoordinates.cpp
processing/qgsalgorithmmergelines.cpp
processing/qgsalgorithmmergevector.cpp
processing/qgsalgorithmminimumenclosingcircle.cpp
processing/qgsalgorithmmultiparttosinglepart.cpp
processing/qgsalgorithmmultiringconstantbuffer.cpp
processing/qgsalgorithmoffsetlines.cpp
processing/qgsalgorithmorderbyexpression.cpp
processing/qgsalgorithmorientedminimumboundingbox.cpp
processing/qgsalgorithmpackage.cpp
processing/qgsalgorithmarrayoffsetlines.cpp
processing/qgsalgorithmpointonsurface.cpp
processing/qgsalgorithmprojectpointcartesian.cpp
processing/qgsalgorithmpromotetomultipart.cpp
processing/qgsalgorithmrasterlayeruniquevalues.cpp
processing/qgsalgorithmreclassifybylayer.cpp
processing/qgsalgorithmremoveduplicatevertices.cpp
processing/qgsalgorithmremoveholes.cpp
processing/qgsalgorithmremovenullgeometry.cpp
processing/qgsalgorithmrenamelayer.cpp
processing/qgsalgorithmreverselinedirection.cpp
processing/qgsalgorithmrotate.cpp
processing/qgsalgorithmsaveselectedfeatures.cpp
processing/qgsalgorithmsegmentize.cpp
processing/qgsalgorithmshortestpathlayertopoint.cpp
processing/qgsalgorithmshortestpathpointtolayer.cpp
processing/qgsalgorithmshortestpathpointtopoint.cpp
processing/qgsalgorithmsimplify.cpp
processing/qgsalgorithmsmooth.cpp
processing/qgsalgorithmsnaptogrid.cpp
processing/qgsalgorithmsplitwithlines.cpp
processing/qgsalgorithmstringconcatenation.cpp
processing/qgsalgorithmswapxy.cpp
processing/qgsalgorithmsubdivide.cpp
processing/qgsalgorithmsymmetricaldifference.cpp
processing/qgsalgorithmtaperedbuffer.cpp
processing/qgsalgorithmtransect.cpp
processing/qgsalgorithmtransform.cpp
processing/qgsalgorithmtranslate.cpp
processing/qgsalgorithmunion.cpp
processing/qgsalgorithmuniquevalueindex.cpp
processing/qgsalgorithmvectorize.cpp
processing/qgsalgorithmwedgebuffers.cpp
processing/qgsalgorithmzonalhistogram.cpp
processing/qgsalgorithmnetworkanalysisbase.cpp
processing/qgsnativealgorithms.cpp
processing/qgsoverlayutils.cpp
processing/qgsrasteranalysisutils.cpp
processing/qgsreclassifyutils.cpp
raster/qgsalignraster.cpp
raster/qgsninecellfilter.cpp
raster/qgsruggednessfilter.cpp
raster/qgsderivativefilter.cpp
raster/qgshillshadefilter.cpp
raster/qgskde.cpp
raster/qgsslopefilter.cpp
raster/qgsaspectfilter.cpp
raster/qgstotalcurvaturefilter.cpp
raster/qgsrelief.cpp
raster/qgsrastercalcnode.cpp
raster/qgsrastercalculator.cpp
raster/qgsrastermatrix.cpp
vector/mersenne-twister.cpp
vector/qgsgeometrysnapper.cpp
vector/qgsgeometrysnappersinglesource.cpp
vector/qgszonalstatistics.cpp
network/qgsgraph.cpp
network/qgsgraphbuilder.cpp
network/qgsgraphbuilderinterface.cpp
network/qgsnetworkspeedstrategy.cpp
network/qgsnetworkdistancestrategy.cpp
network/qgsvectorlayerdirector.cpp
network/qgsgraphanalyzer.cpp
vector/geometry_checker/qgsfeaturepool.cpp
vector/geometry_checker/qgsgeometryanglecheck.cpp
vector/geometry_checker/qgsgeometryareacheck.cpp
vector/geometry_checker/qgsgeometrycheck.cpp
vector/geometry_checker/qgsgeometrycheckcontext.cpp
vector/geometry_checker/qgsgeometrychecker.cpp
vector/geometry_checker/qgsgeometrycheckerror.cpp
vector/geometry_checker/qgsgeometrycheckerutils.cpp
vector/geometry_checker/qgsgeometrycheckfactory.cpp
vector/geometry_checker/qgsgeometrycheckregistry.cpp
vector/geometry_checker/qgsgeometrycontainedcheck.cpp
vector/geometry_checker/qgsgeometrydanglecheck.cpp
vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.cpp
vector/geometry_checker/qgsgeometryduplicatecheck.cpp
vector/geometry_checker/qgsgeometryduplicatenodescheck.cpp
vector/geometry_checker/qgsgeometryfollowboundariescheck.cpp
vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp
vector/geometry_checker/qgsgeometrygapcheck.cpp
vector/geometry_checker/qgsgeometrymissingvertexcheck.cpp
vector/geometry_checker/qgsgeometryholecheck.cpp
vector/geometry_checker/qgsgeometrylineintersectioncheck.cpp
vector/geometry_checker/qgsgeometrylinelayerintersectioncheck.cpp
vector/geometry_checker/qgsgeometrymultipartcheck.cpp
vector/geometry_checker/qgsgeometryoverlapcheck.cpp
vector/geometry_checker/qgsgeometrypointcoveredbylinecheck.cpp
vector/geometry_checker/qgsgeometrypointinpolygoncheck.cpp
vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp
vector/geometry_checker/qgsgeometryselfcontactcheck.cpp
vector/geometry_checker/qgsgeometryselfintersectioncheck.cpp
vector/geometry_checker/qgsgeometrysliverpolygoncheck.cpp
vector/geometry_checker/qgsgeometrytypecheck.cpp
vector/geometry_checker/qgsgeometryisvalidcheck.cpp
vector/geometry_checker/qgssinglegeometrycheck.cpp
vector/geometry_checker/qgssinglegeometrycheck.cpp
vector/geometry_checker/qgsvectordataproviderfeaturepool.cpp
vector/geometry_checker/qgsvectorlayerfeaturepool.cpp
)
SET(QGIS_ANALYSIS_MOC_HDRS
processing/qgsnativealgorithms.h
vector/qgsgeometrysnapper.h
network/qgsgraphdirector.h
network/qgsvectorlayerdirector.h
processing/qgsalgorithmfiledownloader.h
vector/geometry_checker/qgsgeometrychecker.h
vector/geometry_checker/qgsgeometrycheck.h
vector/geometry_checker/qgsvectorlayerfeaturepool.h
)
INCLUDE_DIRECTORIES(SYSTEM ${SPATIALITE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(SYSTEM ${SQLITE3_INCLUDE_DIR})
INCLUDE_DIRECTORIES(BEFORE raster)
ADD_FLEX_FILES_PREFIX(QGIS_ANALYSIS_SRCS raster raster/qgsrastercalclexer.ll)
ADD_BISON_FILES_PREFIX(QGIS_ANALYSIS_SRCS raster raster/qgsrastercalcparser.yy)
IF(NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/analysis/qgsrastercalcparser.cpp
PROPERTIES COMPILE_FLAGS "-w"
)
ELSE(NOT MSVC)
IF(PEDANTIC)
# 4127 expression is constant
# 4702 unreachable code
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/analysis/qgsrastercalcparser.cpp
PROPERTIES COMPILE_FLAGS "-wd4127 -wd4702"
)
ENDIF(PEDANTIC)
ENDIF(NOT MSVC)
IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET_SOURCE_FILES_PROPERTIES(
interpolation/qgstininterpolator.cpp
interpolation/NormVecDecorator.cpp
interpolation/CloughTocherInterpolator.cpp
PROPERTIES COMPILE_FLAGS "-Wno-overloaded-virtual"
)
ENDIF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
QT5_WRAP_CPP(QGIS_ANALYSIS_MOC_SRCS ${QGIS_ANALYSIS_MOC_HDRS})
# install headers
SET(QGIS_ANALYSIS_HDRS
qgsanalysis.h
processing/qgsalgorithmimportphotos.h
processing/qgsreclassifyutils.h
raster/qgsalignraster.h
raster/qgsaspectfilter.h
raster/qgsderivativefilter.h
raster/qgshillshadefilter.h
raster/qgskde.h
raster/qgsninecellfilter.h
raster/qgsrastercalculator.h
raster/qgsrelief.h
raster/qgsruggednessfilter.h
raster/qgsslopefilter.h
raster/qgsrastermatrix.h
raster/qgsrastercalcnode.h
raster/qgstotalcurvaturefilter.h
vector/mersenne-twister.h
vector/qgsgeometrysnapper.h
vector/qgsgeometrysnappersinglesource.h
vector/qgszonalstatistics.h
vector/geometry_checker/qgsgeometrycheckerutils.h
vector/geometry_checker/qgsfeaturepool.h
vector/geometry_checker/qgsvectordataproviderfeaturepool.h
interpolation/qgsinterpolator.h
interpolation/qgsgridfilewriter.h
interpolation/qgsidwinterpolator.h
interpolation/qgstininterpolator.h
interpolation/Bezier3D.h
interpolation/ParametricLine.h
interpolation/CloughTocherInterpolator.h
interpolation/TriangleInterpolator.h
interpolation/Vector3D.h
interpolation/DualEdgeTriangulation.h
interpolation/MathUtils.h
interpolation/TriDecorator.h
interpolation/Triangulation.h
interpolation/HalfEdge.h
interpolation/LinTriangleInterpolator.h
interpolation/NormVecDecorator.h
network/qgsgraph.h
network/qgsgraphbuilderinterface.h
network/qgsgraphbuilder.h
network/qgsnetworkstrategy.h
network/qgsnetworkspeedstrategy.h
network/qgsnetworkdistancestrategy.h
network/qgsgraphanalyzer.h
network/qgsvectorlayerdirector.h
vector/geometry_checker/qgsgeometryanglecheck.h
vector/geometry_checker/qgsgeometryareacheck.h
vector/geometry_checker/qgsgeometrychecker.h
vector/geometry_checker/qgsgeometrycheckerror.h
vector/geometry_checker/qgsgeometrycheckcontext.h
vector/geometry_checker/qgssinglegeometrycheck.h
vector/geometry_checker/qgsgeometrycontainedcheck.h
vector/geometry_checker/qgsgeometrydanglecheck.h
vector/geometry_checker/qgsgeometrydegeneratepolygoncheck.h
vector/geometry_checker/qgsgeometryduplicatecheck.h
vector/geometry_checker/qgsgeometryduplicatenodescheck.h
vector/geometry_checker/qgsgeometryfollowboundariescheck.h
vector/geometry_checker/qgsgeometrygapcheck.h
vector/geometry_checker/qgsgeometrymissingvertexcheck.h
vector/geometry_checker/qgsgeometryholecheck.h
vector/geometry_checker/qgsgeometrylineintersectioncheck.h
vector/geometry_checker/qgsgeometrylinelayerintersectioncheck.h
vector/geometry_checker/qgsgeometrymultipartcheck.h
vector/geometry_checker/qgsgeometryoverlapcheck.h
vector/geometry_checker/qgsgeometrypointcoveredbylinecheck.h
vector/geometry_checker/qgsgeometrypointinpolygoncheck.h
vector/geometry_checker/qgsgeometrysegmentlengthcheck.h
vector/geometry_checker/qgsgeometryselfcontactcheck.h
vector/geometry_checker/qgsgeometryselfintersectioncheck.h
vector/geometry_checker/qgsgeometrysliverpolygoncheck.h
vector/geometry_checker/qgsgeometrytypecheck.h
vector/geometry_checker/qgssinglegeometrycheck.h
vector/geometry_checker/qgsgeometryisvalidcheck.h
vector/geometry_checker/qgsgeometrycheckregistry.h
vector/geometry_checker/qgsgeometrycheckfactory.h
)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/symbology
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/analysis/vector/geometry_checker
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/analysis
interpolation
network
)
INCLUDE_DIRECTORIES(SYSTEM
${SPATIALINDEX_INCLUDE_DIR} # before GEOS for case-insensitive filesystems
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
)
IF(HAVE_OPENCL)
INCLUDE_DIRECTORIES(SYSTEM ${OpenCL_INCLUDE_DIRS})
ENDIF(HAVE_OPENCL)
#############################################################
# qgis_analysis library
ADD_LIBRARY(qgis_analysis SHARED ${QGIS_ANALYSIS_SRCS} ${QGIS_ANALYSIS_MOC_SRCS} ${QGIS_ANALYSIS_HDRS})
GENERATE_EXPORT_HEADER(
qgis_analysis
BASE_NAME ANALYSIS
EXPORT_FILE_NAME qgis_analysis.h
)
IF(MSVC)
SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES LINK_FLAGS "/FORCE:MULTIPLE")
ENDIF(MSVC)
SET(QGIS_ANALYSIS_HDRS ${QGIS_ANALYSIS_HDRS} ${CMAKE_CURRENT_BINARY_DIR}/qgis_analysis.h)
IF(NOT APPLE)
INSTALL(FILES ${QGIS_ANALYSIS_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
ELSE(NOT APPLE)
SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES
# no moc headers, messes up PROPERTIES syntax
CLEAN_DIRECT_OUTPUT 1
FRAMEWORK 1
FRAMEWORK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/framework.info.plist.in"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${COMPLETE_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER org.qgis.qgis3_analysis
BUILD_WITH_INSTALL_RPATH TRUE
PUBLIC_HEADER "${QGIS_ANALYSIS_HDRS}"
LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
)
# generated export header does not get copied with PUBLIC_HEADER files
ADD_CUSTOM_COMMAND(TARGET qgis_analysis
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy qgis_analysis.h
"${QGIS_OUTPUT_DIRECTORY}/${QGIS_LIB_SUBDIR}/qgis_analysis.framework/Headers"
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS qgis_analysis.h
)
ENDIF(NOT APPLE)
#generate unversioned libs for android
IF (NOT ANDROID)
SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES
VERSION ${COMPLETE_VERSION}
SOVERSION ${COMPLETE_VERSION}
)
ENDIF (NOT ANDROID)
TARGET_LINK_LIBRARIES(qgis_analysis qgis_core)
IF(HAVE_OPENCL)
TARGET_LINK_LIBRARIES(qgis_analysis ${OpenCL_LIBRARIES})
ENDIF(HAVE_OPENCL)
# clang-tidy
IF(CLANG_TIDY_EXE)
SET_TARGET_PROPERTIES(
qgis_analysis PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
ENDIF(CLANG_TIDY_EXE)
# install
INSTALL(TARGETS qgis_analysis
RUNTIME DESTINATION ${QGIS_BIN_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR}
ARCHIVE DESTINATION ${QGIS_LIB_DIR}
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR}
PUBLIC_HEADER DESTINATION ${QGIS_INCLUDE_DIR})
# Mac dev frameworks
IF (APPLE AND QGIS_MACAPP_INSTALL_DEV)
INSTALL(TARGETS qgis_analysis FRAMEWORK DESTINATION ${QGIS_MACAPP_DEV_PREFIX})
INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -id \"${QGIS_MACAPP_DEV_PREFIX}/qgis_analysis.framework/Versions/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}/qgis_analysis\" \"$ENV{DESTDIR}${QGIS_MACAPP_DEV_PREFIX}/qgis_analysis.framework/qgis_analysis\")")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -change \"${CMAKE_INSTALL_NAME_DIR}/qgis_core.framework/Versions/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}/qgis_core\" \"${QGIS_MACAPP_DEV_PREFIX}/qgis_core.framework/Versions/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}/qgis_core\" \"$ENV{DESTDIR}${QGIS_MACAPP_DEV_PREFIX}/qgis_analysis.framework/qgis_analysis\")")
ENDIF (APPLE AND QGIS_MACAPP_INSTALL_DEV)