-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
281 lines (246 loc) · 7.03 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
#############################################################
# sources
SET(QGIS_CORE_SRCS
qgis.cpp
qgsapplication.cpp
qgsattributeaction.cpp
qgsclipper.cpp
qgscontexthelp.cpp
qgscoordinatetransform.cpp
qgsdatasourceuri.cpp
qgsdistancearea.cpp
qgsexception.cpp
qgsfeature.cpp
qgsfield.cpp
qgsgeometry.cpp
qgshttptransaction.cpp
qgslabel.cpp
qgslabelattributes.cpp
qgsline.cpp
qgslogger.cpp
qgsmaplayer.cpp
qgsmaplayerregistry.cpp
qgsmaprender.cpp
qgsmaptopixel.cpp
qgsmessageoutput.cpp
qgspoint.cpp
qgsproject.cpp
qgsprojectfiletransform.cpp
qgsprojectversion.cpp
qgsprojectproperty.cpp
qgsprovidercountcalcevent.cpp
qgsproviderextentcalcevent.cpp
qgsprovidermetadata.cpp
qgsproviderregistry.cpp
qgsrasterdataprovider.cpp
qgsrect.cpp
qgsrunprocess.cpp
qgsscalecalculator.cpp
qgssearchstring.cpp
qgssearchtreenode.cpp
qgssnapper.cpp
qgsspatialrefsys.cpp
qgsvectordataprovider.cpp
qgsvectorfilewriter.cpp
qgsvectorlayer.cpp
raster/qgscliptominmaxenhancement.cpp
raster/qgscolorrampshader.cpp
raster/qgscolortable.cpp
raster/qgscontrastenhancement.cpp
raster/qgscontrastenhancementfunction.cpp
raster/qgsfreakoutshader.cpp
raster/qgslinearminmaxenhancement.cpp
raster/qgslinearminmaxenhancementwithclip.cpp
raster/qgspseudocolorshader.cpp
raster/qgsrasterlayer.cpp
raster/qgsrastertransparency.cpp
raster/qgsrastershader.cpp
raster/qgsrastershaderfunction.cpp
renderer/qgscontinuouscolorrenderer.cpp
renderer/qgsgraduatedsymbolrenderer.cpp
renderer/qgsrenderer.cpp
renderer/qgssinglesymbolrenderer.cpp
renderer/qgsuniquevaluerenderer.cpp
symbology/qgsmarkercatalogue.cpp
symbology/qgssymbol.cpp
symbology/qgssymbologyutils.cpp
spatialindex/qgsspatialindex.cpp
)
IF (WITH_INTERNAL_SQLITE3)
SET(QGIS_CORE_SRCS
${QGIS_CORE_SRCS}
sqlite3/sqlite3.c
)
ENDIF (WITH_INTERNAL_SQLITE3)
ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)
ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy)
# Disable compiler warnings for lex generated sources
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/core/flex_qgssearchstringlexer.cpp
PROPERTIES COMPILE_FLAGS -w)
SET(QGIS_CORE_MOC_HDRS
qgscontexthelp.h
qgscoordinatetransform.h
qgsdataprovider.h
qgshttptransaction.h
qgsmaplayer.h
qgsmaplayerregistry.h
qgsmaprender.h
qgsmessageoutput.h
qgsproject.h
qgsrunprocess.h
qgsvectorlayer.h
qgsrasterdataprovider.h
raster/qgsrasterlayer.h
)
QT4_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
raster
renderer
symbology
spatialindex/include
${QT_QTSVG_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
)
IF (WITH_INTERNAL_SQLITE3)
INCLUDE_DIRECTORIES(sqlite3)
ELSE (WITH_INTERNAL_SQLITE3)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (WITH_INTERNAL_SQLITE3)
IF (WIN32)
IF (MSVC)
ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllexport)")
ELSE (MSVC)
ADD_DEFINITIONS("-UCORE_EXPORT \"-DCORE_EXPORT=__declspec(dllexport)\"")
ENDIF (MSVC)
ENDIF (WIN32)
#############################################################
# spatial indexing library
# add path prefix to every specified file
MACRO(PATH_PREFIX OUTPUT PREFIX)
FOREACH(F ${ARGN})
SET(${OUTPUT} ${${OUTPUT}} ${PREFIX}/${F})
ENDFOREACH(F)
ENDMACRO(PATH_PREFIX)
# tools library
PATH_PREFIX(TOOLS_SRC tools ExternalSort.cc ExternalSort.h TemporaryFile.cc Tools.cc)
PATH_PREFIX(GEOM_SRC geometry LineSegment.cc Point.cc Region.cc)
# spatial index library
PATH_PREFIX(SPINDEX_SRC spatialindex SpatialIndexImpl.cc)
PATH_PREFIX(STMAN_SRC storagemanager Buffer.cc DiskStorageManager.cc MemoryStorageManager.cc RandomEvictionsBuffer.cc)
PATH_PREFIX(RTREE_SRC rtree BulkLoader.cc Index.cc Leaf.cc Node.cc RTree.cc Statistics.cc)
SET(SPINDEX_SRC ${TOOLS_SRC} ${GEOM_SRC} ${SPINDEX_SRC} ${STMAN_SRC} ${RTREE_SRC})
PATH_PREFIX(INDEX_SRC spatialindex ${SPINDEX_SRC})
#############################################################
# qgis_core library
ADD_LIBRARY(qgis_core SHARED ${QGIS_CORE_SRCS} ${QGIS_CORE_MOC_SRCS} ${INDEX_SRC})
# make sure to create qgssvnversion.h before compiling
ADD_DEPENDENCIES(qgis_core svnversion)
# because of htonl
IF (WIN32)
SET(PLATFORM_LIBRARIES wsock32)
IF (MSVC)
#needed for linking to gdal which needs odbc
SET(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} odbc32 odbccp32)
ENDIF (MSVC)
ENDIF (WIN32)
TARGET_LINK_LIBRARIES(qgis_core
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
${QT_QTXML_LIBRARY}
#${QT_QTSQL_LIBRARY}
${QT_QTSVG_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTMAIN_LIBRARY}
${QT_QT3SUPPORT_LIBRARY}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
${PLATFORM_LIBRARIES}
)
#work aroud for the fact that qt3 support on mac is linked ot qsql
IF (APPLE)
TARGET_LINK_LIBRARIES(qgis_core
${QT_QTSQL_LIBRARY}
)
ENDIF (APPLE)
IF (NOT WITH_INTERNAL_SQLITE3)
TARGET_LINK_LIBRARIES(qgis_core ${SQLITE3_LIBRARY})
ENDIF (NOT WITH_INTERNAL_SQLITE3)
INSTALL(TARGETS qgis_core
RUNTIME DESTINATION ${QGIS_BIN_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR}
ARCHIVE DESTINATION ${QGIS_LIB_DIR})
# Added by Tim to install headers
SET(QGIS_CORE_HDRS
qgis.h
qgsapplication.h
qgsattributeaction.h
qgsclipper.h
qgscontexthelp.h
qgscoordinatetransform.h
qgsdatasourceuri.h
qgsdistancearea.h
qgscsexception.h
qgsexception.h
qgsfeature.h
qgsfield.h
qgsgeometry.h
qgshttptransaction.h
qgslabel.h
qgslabelattributes.h
qgsline.h
qgslogger.h
qgsmaplayer.h
qgsmaplayerregistry.h
qgsmaprender.h
qgsmaptopixel.h
qgsmessageoutput.h
qgspoint.h
qgsproject.h
qgsprojectfiletransform.h
qgsprojectproperty.h
qgsprovidercountcalcevent.h
qgsproviderextentcalcevent.h
qgsprovidermetadata.h
qgsproviderregistry.h
qgsrasterdataprovider.h
qgsrect.h
qgsrunprocess.h
qgsscalecalculator.h
qgssearchstring.h
qgssearchtreenode.h
qgssnapper.h
qgsspatialrefsys.h
qgsvectordataprovider.h
qgsvectorfilewriter.h
qgsvectorlayer.h
raster/qgscliptominmaxenhancement.h
raster/qgscolorrampshader.h
raster/qgscolortable.h
raster/qgscolorrampshader.h
raster/qgscontrastenhancement.h
raster/qgscontrastenhancementfunction.h
raster/qgsfreakoutshader.h
raster/qgslinearminmaxenhancement.h
raster/qgslinearminmaxenhancementwithclip.h
raster/qgspseudocolorshader.h
raster/qgsrasterbandstats.h
raster/qgsrasterlayer.h
raster/qgsrastertransparency.h
raster/qgsrastershader.h
raster/qgsrastershaderfunction.h
renderer/qgscontinuouscolorrenderer.h
renderer/qgsgraduatedsymbolrenderer.h
renderer/qgsrenderer.h
renderer/qgssinglesymbolrenderer.h
renderer/qgsuniquevaluerenderer.h
symbology/qgsmarkercatalogue.h
symbology/qgssymbol.h
symbology/qgssymbologyutils.h
spatialindex/qgsspatialindex.h
)
INSTALL(CODE "MESSAGE(\"Installing CORE headers...\")")
INSTALL(FILES ${QGIS_CORE_HDRS} ${QGIS_CORE_MOC_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})