-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
355 lines (311 loc) · 8.62 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
#############################################################
# sources
SET(QGIS_CORE_SRCS
qgis.cpp
qgsapplication.cpp
qgsattributeaction.cpp
qgscentralpointpositionmanager.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
qgslogger.cpp
qgsmaplayer.cpp
qgsmaplayerregistry.cpp
qgsmaprenderer.cpp
qgsmaptopixel.cpp
qgsmessageoutput.cpp
qgsoverlayobject.cpp
qgspalobjectpositionmanager.cpp
qgspoint.cpp
qgsproject.cpp
qgsprojectfiletransform.cpp
qgsprojectversion.cpp
qgsprojectproperty.cpp
qgsprovidercountcalcevent.cpp
qgsproviderextentcalcevent.cpp
qgsprovidermetadata.cpp
qgsproviderregistry.cpp
qgsrasterdataprovider.cpp
qgsrendercontext.cpp
qgsrectangle.cpp
qgsrunprocess.cpp
qgsscalecalculator.cpp
qgssearchstring.cpp
qgssearchtreenode.cpp
qgssnapper.cpp
qgscoordinatereferencesystem.cpp
qgstolerance.cpp
qgsvectordataprovider.cpp
qgsvectorfilewriter.cpp
qgsvectorlayer.cpp
qgsvectoroverlay.cpp
composer/qgscomposeritem.cpp
composer/qgscomposeritemgroup.cpp
composer/qgscomposerlabel.cpp
composer/qgscomposerpicture.cpp
composer/qgscomposermap.cpp
composer/qgscomposerscalebar.cpp
composer/qgslegendmodel.cpp
composer/qgscomposerlegend.cpp
composer/qgspaperitem.cpp
composer/qgsscalebarstyle.cpp
composer/qgsdoubleboxscalebarstyle.cpp
composer/qgsnumericscalebarstyle.cpp
composer/qgssingleboxscalebarstyle.cpp
composer/qgsticksscalebarstyle.cpp
composer/qgscomposition.cpp
pal/feature.cpp
pal/geomfunction.cpp
pal/label.cpp
pal/labelposition.cpp
pal/layer.cpp
pal/pal.cpp
pal/palstat.cpp
pal/pointset.cpp
pal/priorityqueue.cpp
pal/problem.cpp
pal/util.cpp
pal/linkedlist.hpp
pal/hashtable.hpp
pal/rtree.hpp
raster/qgscliptominmaxenhancement.cpp
raster/qgscolorrampshader.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_SPATIALITE)
IF (WIN32 OR APPLE)
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
ENDIF (WIN32 OR APPLE)
IF (WIN32)
ADD_DEFINITIONS(-DDLL_EXPORT)
ENDIF (WIN32)
SET(QGIS_CORE_SRCS
${QGIS_CORE_SRCS}
spatialite/sqlite3.c
spatialite/spatialite.c
)
INCLUDE_DIRECTORIES(spatialite/headers)
ENDIF (WITH_INTERNAL_SPATIALITE)
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)
IF (MSVC AND PEDANTIC)
# disable warnings
# 4065 switch with default and no case
# 4702 unreachable code
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/core/qgssearchstringparser.cpp
PROPERTIES COMPILE_FLAGS "-wd4065 -wd4702")
ENDIF (MSVC AND PEDANTIC)
SET(QGIS_CORE_MOC_HDRS
qgsapplication.h
qgscontexthelp.h
qgscoordinatetransform.h
qgsdataprovider.h
qgshttptransaction.h
qgsmaplayer.h
qgsmaplayerregistry.h
qgsmaprenderer.h
qgsmessageoutput.h
qgsproject.h
qgsrunprocess.h
qgsvectorlayer.h
qgsrasterdataprovider.h
composer/qgscomposerlegend.h
composer/qgscomposermap.h
composer/qgscomposerpicture.h
composer/qgscomposerscalebar.h
composer/qgscomposeritemgroup.h
composer/qgslegendmodel.h
raster/qgsrasterlayer.h
)
QT4_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
composer
pal
raster
renderer
symbology
spatialindex/include
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
)
IF (NOT WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
IF (WIN32)
IF (MSVC)
ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllexport)")
ELSE (MSVC)
ADD_DEFINITIONS("-UCORE_EXPORT \"-DCORE_EXPORT=__declspec(dllexport)\"")
ENDIF (MSVC)
ENDIF (WIN32)
#for PAL classes
IF (WIN32)
ADD_DEFINITIONS("-D_HAVE_WINDOWS_H_")
ELSE (WIN32)
ADD_DEFINITIONS("-D_HAVE_PTHREAD_")
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})
SET_TARGET_PROPERTIES(qgis_core PROPERTIES
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}
SOVERSION ${COMPLETE_VERSION})
# 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_QTSVG_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTMAIN_LIBRARY}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}
${PLATFORM_LIBRARIES}
)
IF (WITH_INTERNAL_SPATIALITE)
IF (WIN32 OR APPLE)
TARGET_LINK_LIBRARIES(qgis_core ${ICONV_LIBRARY})
ENDIF (WIN32 OR APPLE)
IF (UNIX)
TARGET_LINK_LIBRARIES(qgis_core pthread)
ENDIF (UNIX)
ELSE (WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis_core ${SQLITE3_LIBRARY})
ENDIF (WITH_INTERNAL_SPATIALITE)
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
qgslogger.h
qgsmaplayer.h
qgsmaplayerregistry.h
qgsmaprenderer.h
qgsmaptopixel.h
qgsmessageoutput.h
qgspoint.h
qgsproject.h
qgsprojectfiletransform.h
qgsprojectproperty.h
qgsprojectversion.h
qgsprovidercountcalcevent.h
qgsproviderextentcalcevent.h
qgsprovidermetadata.h
qgsproviderregistry.h
qgsrasterdataprovider.h
qgsrectangle.h
qgsrendercontext.h
qgsrunprocess.h
qgsscalecalculator.h
qgssearchstring.h
qgssearchtreenode.h
qgssnapper.h
qgscoordinatereferencesystem.h
qgsvectordataprovider.h
qgsvectorfilewriter.h
qgsvectorlayer.h
qgstolerance.h
raster/qgscliptominmaxenhancement.h
raster/qgscolorrampshader.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})