-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
233 lines (202 loc) · 7.17 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
#############################################################
# sources
SET(QGIS_ANALYSIS_SRCS
interpolation/qgsgridfilewriter.cpp
interpolation/qgsidwinterpolator.cpp
interpolation/qgsinterpolator.cpp
interpolation/qgstininterpolator.cpp
interpolation/Bezier3D.cc
interpolation/CloughTocherInterpolator.cc
interpolation/DualEdgeTriangulation.cc
interpolation/HalfEdge.cc
interpolation/Line3D.cc
interpolation/LinTriangleInterpolator.cc
interpolation/MathUtils.cc
interpolation/NormVecDecorator.cc
interpolation/Node.cc
interpolation/ParametricLine.cc
interpolation/Point3D.cc
interpolation/TriangleInterpolator.cc
interpolation/Triangulation.cc
interpolation/TriDecorator.cc
interpolation/Vector3D.cc
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/qgsgeometryanalyzer.cpp
vector/qgsgeometrysnapper.cpp
vector/qgspointsample.cpp
vector/qgstransectsample.cpp
vector/qgszonalstatistics.cpp
vector/qgsoverlayanalyzer.cpp
openstreetmap/qgsosmbase.cpp
openstreetmap/qgsosmdatabase.cpp
openstreetmap/qgsosmdownload.cpp
openstreetmap/qgsosmimport.cpp
network/qgsgraph.cpp
network/qgsgraphbuilder.cpp
network/qgsnetworkspeedstrategy.cpp
network/qgsnetworkdistancestrategy.cpp
network/qgsvectorlayerdirector.cpp
network/qgsgraphanalyzer.cpp
)
SET(QGIS_ANALYSIS_MOC_HDRS
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
vector/qgsgeometrysnapper.h
network/qgsgraphdirector.h
network/qgsvectorlayerdirector.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.cc
interpolation/CloughTocherInterpolator.cc
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
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/qgsgeometryanalyzer.h
vector/qgszonalstatistics.h
vector/qgsoverlayanalyzer.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/Point3D.h
interpolation/Vector3D.h
interpolation/DualEdgeTriangulation.h
interpolation/Node.h
interpolation/TriDecorator.h
interpolation/Triangulation.h
interpolation/HalfEdge.h
interpolation/LinTriangleInterpolator.h
interpolation/NormVecDecorator.h
interpolation/Line3D.h
openstreetmap/qgsosmbase.h
openstreetmap/qgsosmdatabase.h
openstreetmap/qgsosmdownload.h
openstreetmap/qgsosmimport.h
network/qgsgraph.h
network/qgsgraphbuilderinterface.h
network/qgsgraphbuilder.h
network/qgsnetworkstrategy.h
network/qgsnetworkspeedstrategy.h
network/qgsnetworkdistancestrategy.h
network/qgsgraphdirector.h
network/qgsvectorlayerdirector.h
network/qgsgraphanalyzer.h
)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../core/
${CMAKE_CURRENT_SOURCE_DIR}/../core/geometry
${CMAKE_CURRENT_SOURCE_DIR}/../core/raster
${CMAKE_CURRENT_SOURCE_DIR}/../core/symbology-ng
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/analysis
interpolation
network
)
INCLUDE_DIRECTORIES(SYSTEM
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
)
#############################################################
# qgis_analysis library
ADD_LIBRARY(qgis_analysis SHARED ${QGIS_ANALYSIS_SRCS} ${QGIS_ANALYSIS_MOC_SRCS} ${QGIS_ANALYSIS_HDRS})
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}"
)
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)
GENERATE_EXPORT_HEADER(
qgis_analysis
BASE_NAME ANALYSIS
EXPORT_FILE_NAME qgis_analysis.h
)
SET(QGIS_ANALYSIS_HDRS ${QGIS_ANALYSIS_HDRS} ${PROJECT_BINARY_DIR}/qgis_analysis.h)
# 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)