-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
CMakeLists.txt
518 lines (468 loc) · 14 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
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
SET(QGIS_APP_SRCS
main.cpp
qgisapp.cpp
qgisappinterface.cpp
qgisappstylesheet.cpp
qgsabout.cpp
qgssponsors.cpp
qgsaddattrdialog.cpp
qgsaddtaborgroup.cpp
qgsaddjoindialog.cpp
qgsannotationwidget.cpp
qgsattributeactiondialog.cpp
qgsattributedialog.cpp
qgsattributetypedialog.cpp
qgsattributetypeloaddialog.cpp
qgsattributetabledialog.cpp
qgsbookmarks.cpp
qgsbrowserdockwidget.cpp
qgsclipboard.cpp
qgscontinuouscolordialog.cpp
qgsconfigureshortcutsdialog.cpp
qgscustomization.cpp
qgscustomprojectiondialog.cpp
qgsdecorationitem.cpp
qgsdecorationcopyright.cpp
qgsdecorationcopyrightdialog.cpp
qgsdecorationnortharrow.cpp
qgsdecorationnortharrowdialog.cpp
qgsdecorationscalebar.cpp
qgsdecorationscalebardialog.cpp
qgsdecorationgrid.cpp
qgsdecorationgriddialog.cpp
qgsformannotationdialog.cpp
qgshtmlannotationdialog.cpp
qgsdelattrdialog.cpp
qgsdiagramproperties.cpp
qgsdisplayangle.cpp
qgsfieldcalculator.cpp
qgsfieldsproperties.cpp
qgsgraduatedsymboldialog.cpp
qgsidentifyresultsdialog.cpp
qgsfeatureaction.cpp
qgslabeldialog.cpp
qgslabelpropertydialog.cpp
qgslabelengineconfigdialog.cpp
qgslabelinggui.cpp
qgslabelpreview.cpp
qgsmaptooladdfeature.cpp
qgsmaptooladdvertex.cpp
qgsmaptooladdpart.cpp
qgsmaptooladdring.cpp
qgsmaptoolannotation.cpp
qgsmaptoolcapture.cpp
qgsmaptoolchangelabelproperties.cpp
qgsmaptooldeletering.cpp
qgsmaptooldeletepart.cpp
qgsmaptooldeletevertex.cpp
qgsmaptooledit.cpp
qgsmaptoolfeatureaction.cpp
qgsmaptoolformannotation.cpp
qgsmaptoolhtmlannotation.cpp
qgsmaptoolpinlabels.cpp
qgsmaptoolshowhidelabels.cpp
qgsmaptoolidentifyaction.cpp
qgsmaptoollabel.cpp
qgsmaptoolmeasureangle.cpp
qgsmaptoolmovefeature.cpp
qgsmaptoolmovelabel.cpp
qgsmaptoolmovevertex.cpp
qgsmaptooloffsetcurve.cpp
qgsmaptoolreshape.cpp
qgsmaptoolrotatefeature.cpp
qgsmaptoolrotatelabel.cpp
qgsmaptoolrotatepointsymbols.cpp
qgsmaptoolselect.cpp
qgsmaptoolselectrectangle.cpp
qgsmaptoolselectfreehand.cpp
qgsmaptoolselectpolygon.cpp
qgsmaptoolselectradius.cpp
qgsmaptoolselectutils.cpp
qgsmaptoolsimplify.cpp
qgsmaptoolsplitfeatures.cpp
qgsmaptoolsvgannotation.cpp
qgsmaptooltextannotation.cpp
qgsmaptoolvertexedit.cpp
nodetool/qgsmaptoolnodetool.cpp
nodetool/qgsselectedfeature.cpp
nodetool/qgsvertexentry.cpp
qgsmeasuredialog.cpp
qgsmeasuretool.cpp
qgsmergeattributesdialog.cpp
qgsoptions.cpp
#qgspastetransformations.cpp
qgspointrotationitem.cpp
qgspluginitem.cpp
qgspluginmanager.cpp
qgspluginmetadata.cpp
qgspluginregistry.cpp
qgsprojectlayergroupdialog.cpp
qgsprojectproperties.cpp
qgsrastercalcdialog.cpp
qgsrasterlayerproperties.cpp
qgstextannotationdialog.cpp
qgsshortcutsmanager.cpp
qgssinglesymboldialog.cpp
qgssnappingdialog.cpp
qgssvgannotationdialog.cpp
qgsundowidget.cpp
qgstipgui.cpp
qgstipfactory.cpp
qgsuniquevaluedialog.cpp
qgsvectorlayerproperties.cpp
qgshighlight.cpp
qgshandlebadlayers.cpp
composer/qgsattributeselectiondialog.cpp
composer/qgscomposer.cpp
composer/qgscomposerarrowwidget.cpp
composer/qgscomposerhtmlwidget.cpp
composer/qgscomposeritemwidget.cpp
composer/qgscomposerlabelwidget.cpp
composer/qgscomposerpicturewidget.cpp
composer/qgscomposermanager.cpp
composer/qgscomposermapwidget.cpp
composer/qgscomposerscalebarwidget.cpp
composer/qgscomposershapewidget.cpp
composer/qgscomposertablewidget.cpp
composer/qgscomposerlegenditemdialog.cpp
composer/qgscomposerlegendlayersdialog.cpp
composer/qgscomposerlegendwidget.cpp
composer/qgscompositionwidget.cpp
composer/qgsatlascompositionwidget.cpp
legend/qgslegendgroup.cpp
legend/qgslegend.cpp
legend/qgsapplegendinterface.cpp
legend/qgslegenditem.cpp
legend/qgslegendlayer.cpp
legend/qgslegendpropertygroup.cpp
legend/qgslegendpropertyitem.cpp
legend/qgslegendsymbologygroup.cpp
legend/qgslegendsymbologyitem.cpp
legend/qgslegendvectorsymbologyitem.cpp
legend/qgslayerorder.cpp
ogr/qgsogrhelperfunctions.cpp
ogr/qgsopenvectorlayerdialog.cpp
ogr/qgsnewogrconnection.cpp
ogr/qgsogrsublayersdialog.cpp
ogr/qgsvectorlayersaveasdialog.cpp
gps/qgsgpsinformationwidget.cpp
gps/qgsgpsmarker.cpp
)
IF (ANDROID)
SET(QGIS_APP_SRCS
${QGIS_APP_SRCS}
qtmain_android.cpp
)
ENDIF (ANDROID)
SET (QGIS_APP_MOC_HDRS
qgisapp.h
qgisappinterface.h
qgisappstylesheet.h
qgsabout.h
qgsaddattrdialog.h
qgsaddjoindialog.h
qgsaddtaborgroup.h
qgsannotationwidget.h
qgsattributeactiondialog.h
qgsattributedialog.h
qgsattributetypedialog.h
qgsattributetypeloaddialog.h
qgsattributetabledialog.h
qgsbookmarks.h
qgsbrowserdockwidget.h
qgsconfigureshortcutsdialog.h
qgscontinuouscolordialog.h
qgscustomization.h
qgscustomprojectiondialog.h
qgsdecorationitem.h
qgsdecorationcopyright.h
qgsdecorationcopyrightdialog.h
qgsdecorationnortharrow.h
qgsdecorationnortharrowdialog.h
qgsdecorationscalebar.h
qgsdecorationscalebardialog.h
qgsdecorationgrid.h
qgsdecorationgriddialog.h
qgsdelattrdialog.h
qgsdiagramproperties.h
qgsdisplayangle.h
qgsfeatureaction.h
qgsfieldcalculator.h
qgsfieldsproperties.h
qgsformannotationdialog.h
qgshtmlannotationdialog.h
qgsgraduatedsymboldialog.h
qgsidentifyresultsdialog.h
qgslabeldialog.h
qgslabelengineconfigdialog.h
qgslabelinggui.h
qgslabelpropertydialog.h
qgsshortcutsmanager.h
qgsmaptooladdfeature.h
qgsmaptoolcapture.h
qgsmaptooladdpart.h
qgsmaptooladdring.h
qgsmaptooladdvertex.h
qgsmaptoolchangelabelproperties.h
qgsmaptooldeletepart.h
qgsmaptooldeletering.h
qgsmaptooldeletevertex.h
qgsmaptoolfeatureaction.h
qgsmaptoolpinlabels.h
qgsmaptoolshowhidelabels.h
qgsmaptoolidentifyaction.h
qgsmaptoolmeasureangle.h
qgsmaptoolmovefeature.h
qgsmaptoolmovelabel.h
qgsmaptoolmovevertex.h
qgsmaptooloffsetcurve.h
qgsmaptoolreshape.h
qgsmaptoolrotatefeature.h
qgsmaptoolrotatelabel.h
qgsmaptoolrotatepointsymbols.h
qgsmaptoolselectfreehand.h
qgsmaptoolselect.h
qgsmaptoolselectpolygon.h
qgsmaptoolselectradius.h
qgsmaptoolselectrectangle.h
qgsmaptoolsimplify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolvertexedit.h
nodetool/qgsmaptoolnodetool.h
nodetool/qgsselectedfeature.h
qgsmeasuredialog.h
qgsmeasuretool.h
qgsmergeattributesdialog.h
qgsoptions.h
#qgspastetransformations.h
qgspluginmanager.h
qgsprojectlayergroupdialog.h
qgsprojectproperties.h
qgsrastercalcdialog.h
qgsrasterlayerproperties.h
qgssinglesymboldialog.h
qgssnappingdialog.h
qgssponsors.h
qgssvgannotationdialog.h
qgstextannotationdialog.h
qgstipgui.h
qgstipfactory.h
qgsundowidget.h
qgsuniquevaluedialog.h
qgsvectorlayerproperties.h
qgshandlebadlayers.h
composer/qgsattributeselectiondialog.h
composer/qgscomposer.h
composer/qgscomposerarrowwidget.h
composer/qgscomposerhtmlwidget.h
composer/qgscomposeritemwidget.h
composer/qgscomposerlabelwidget.h
composer/qgscomposerlegendwidget.h
composer/qgscomposermanager.h
composer/qgscomposermapwidget.h
composer/qgscomposerpicturewidget.h
composer/qgscomposerscalebarwidget.h
composer/qgscomposertablewidget.h
composer/qgscomposershapewidget.h
composer/qgscompositionwidget.h
composer/qgsatlascompositionwidget.h
legend/qgslegend.h
legend/qgsapplegendinterface.h
legend/qgslegendlayer.h
legend/qgslayerorder.h
ogr/qgsopenvectorlayerdialog.h
ogr/qgsnewogrconnection.h
ogr/qgsogrsublayersdialog.h
ogr/qgsvectorlayersaveasdialog.h
gps/qgsgpsinformationwidget.h
)
IF(WITH_INTERNAL_QWTPOLAR)
IF(QWT_VERSION_STR VERSION_LESS "6.0.0")
SET(QGIS_APP_SRCS
${QGIS_APP_SRCS}
gps/qwtpolar-0.1/qwt_polar_canvas.cpp
gps/qwtpolar-0.1/qwt_polar_curve.cpp
gps/qwtpolar-0.1/qwt_polar_fitter.cpp
gps/qwtpolar-0.1/qwt_polar_grid.cpp
gps/qwtpolar-0.1/qwt_polar_itemdict.cpp
gps/qwtpolar-0.1/qwt_polar_item.cpp
gps/qwtpolar-0.1/qwt_polar_layout.cpp
gps/qwtpolar-0.1/qwt_polar_magnifier.cpp
gps/qwtpolar-0.1/qwt_polar_marker.cpp
gps/qwtpolar-0.1/qwt_polar_panner.cpp
gps/qwtpolar-0.1/qwt_polar_plot.cpp
gps/qwtpolar-0.1/qwt_polar_point.cpp
gps/qwtpolar-0.1/qwt_polar_spectrogram.cpp
)
SET (QGIS_APP_MOC_HDRS
${QGIS_APP_MOC_HDRS}
gps/qwtpolar-0.1/qwt_polar_canvas.h
gps/qwtpolar-0.1/qwt_polar_magnifier.h
gps/qwtpolar-0.1/qwt_polar_panner.h
gps/qwtpolar-0.1/qwt_polar_plot.h
)
SET(QWTPOLAR_INCLUDE_DIR gps/qwtpolar-0.1)
ELSE(QWT_VERSION_STR VERSION_LESS "6.0.0")
SET(QGIS_APP_SRCS
${QGIS_APP_SRCS}
gps/qwtpolar-1.0/qwt_polar_canvas.cpp
gps/qwtpolar-1.0/qwt_polar_curve.cpp
gps/qwtpolar-1.0/qwt_polar_fitter.cpp
gps/qwtpolar-1.0/qwt_polar_grid.cpp
gps/qwtpolar-1.0/qwt_polar_item.cpp
gps/qwtpolar-1.0/qwt_polar_itemdict.cpp
gps/qwtpolar-1.0/qwt_polar_layout.cpp
gps/qwtpolar-1.0/qwt_polar_magnifier.cpp
gps/qwtpolar-1.0/qwt_polar_marker.cpp
gps/qwtpolar-1.0/qwt_polar_panner.cpp
gps/qwtpolar-1.0/qwt_polar_picker.cpp
gps/qwtpolar-1.0/qwt_polar_plot.cpp
gps/qwtpolar-1.0/qwt_polar_renderer.cpp
gps/qwtpolar-1.0/qwt_polar_spectrogram.cpp
)
SET (QGIS_APP_MOC_HDRS
${QGIS_APP_MOC_HDRS}
gps/qwtpolar-1.0/qwt_polar_canvas.h
gps/qwtpolar-1.0/qwt_polar_magnifier.h
gps/qwtpolar-1.0/qwt_polar_panner.h
gps/qwtpolar-1.0/qwt_polar_picker.h
gps/qwtpolar-1.0/qwt_polar_plot.h
gps/qwtpolar-1.0/qwt_polar_renderer.h
)
SET(QWTPOLAR_INCLUDE_DIR gps/qwtpolar-1.0)
ENDIF(QWT_VERSION_STR VERSION_LESS "6.0.0")
SET(QWTPOLAR_LIBRARY "")
ENDIF(WITH_INTERNAL_QWTPOLAR)
IF (POSTGRES_FOUND)
IF(HAVE_PGCONFIG)
ADD_DEFINITIONS(-DHAVE_PGCONFIG=1)
ENDIF(HAVE_PGCONFIG)
ENDIF (POSTGRES_FOUND)
IF (HAVE_SPATIALITE)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
qgsnewspatialitelayerdialog.cpp
)
SET (QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
qgsnewspatialitelayerdialog.h
)
ENDIF(HAVE_SPATIALITE)
SET(IMAGE_RCCS ../../images/images.qrc)
QT4_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})
QT4_WRAP_CPP(QGIS_APP_MOC_SRCS ${QGIS_APP_MOC_HDRS})
IF (WIN32)
IF (MSVC)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)
ELSE(MSVC)
# Icon for windows MINGW
# Note: can't include .rc directly to source files
# as it's ignored when used MinGW
IF (NOT WINDRES)
FIND_PROGRAM(WINDRES windres)
IF (NOT WINDRES)
MESSAGE(FATAL_ERROR "windres not found - aborting")
ENDIF (NOT WINDRES)
ENDIF (NOT WINDRES)
#############################################################
# application icon
# resource compilation for MinGW
ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon.o
COMMAND ${WINDRES} -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/icon.o )
SET(QGIS_APP_SRCS ${QGIS_APP_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
ENDIF (MSVC)
ENDIF (WIN32)
IF(PEDANTIC)
# disable deprecation warnings
IF(NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(qgisappinterface.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated)
ENDIF(NOT MSVC)
ENDIF(PEDANTIC)
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} composer legend attributetable
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../ui
${QWT_INCLUDE_DIR}
${QT_QTUITOOLS_INCLUDE_DIR}
${QEXTSERIALPORT_INCLUDE_DIR}
../analysis/raster
../core
../core/gps
../core/composer ../core/raster ../core/renderer ../core/symbology ../core/symbology-ng
../gui ../gui/symbology-ng ../gui/attributetable ../gui/raster
../plugins
../python
gps
)
IF (ANDROID)
INCLUDE_DIRECTORIES(${ANDROID_NDK_TOOLCHAIN_ROOT}/sysroot/usr/include)
ENDIF (ANDROID)
IF (HAVE_SPATIALITE)
IF (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(../core/spatialite/headers)
INCLUDE_DIRECTORIES(../core/spatialite/headers/spatialite)
ELSE (WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SPATIALITE_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ADD_DEFINITIONS(-DEXTERNAL_SPATIALITE)
ENDIF (WITH_INTERNAL_SPATIALITE)
ENDIF (HAVE_SPATIALITE)
INCLUDE_DIRECTORIES(
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${QWTPOLAR_INCLUDE_DIR}
)
IF (POSTGRES_FOUND)
INCLUDE_DIRECTORIES(${POSTGRES_INCLUDE_DIR})
ENDIF (POSTGRES_FOUND)
#############
IF (ANDROID)
ADD_LIBRARY(${QGIS_APP_NAME} SHARED ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${QGIS_APP_HDRS} ${QGIS_APP_MOC_HDRS} ${IMAGE_RCC_SRCS})
ELSE (ANDROID)
ADD_EXECUTABLE(${QGIS_APP_NAME} MACOSX_BUNDLE WIN32 ${QGIS_APP_SRCS} ${QGIS_APP_MOC_SRCS} ${IMAGE_RCC_SRCS})
ENDIF (ANDROID)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
${QWT_LIBRARY}
${QT_QTSQL_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
${QWTPOLAR_LIBRARY}
${GDAL_LIBRARY}
qgis_core
qgis_gui
qgis_analysis
)
IF (ANDROID)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} log)
ENDIF (ANDROID)
IF(WIN32)
ADD_DEFINITIONS(-DQWT_DLL)
ENDIF(WIN32)
IF(NOT WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} ${SQLITE_LIBRARY})
ENDIF(NOT WITH_INTERNAL_SPATIALITE)
IF (APPLE)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} ${APP_SERVICES_LIBRARY} )
SET_TARGET_PROPERTIES(${QGIS_APP_NAME} PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
INSTALL_RPATH_USE_LINK_PATH true
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/app.info.plist.in")
ENDIF(APPLE)
IF (POSTGRES_FOUND)
TARGET_LINK_LIBRARIES (${QGIS_APP_NAME} ${POSTGRES_LIBRARY})
ENDIF (POSTGRES_FOUND)
IF(MSVC)
INSTALL(FILES qgis.ico DESTINATION ${CMAKE_INSTALL_PREFIX}/icons)
ENDIF(MSVC)
INSTALL(TARGETS ${QGIS_APP_NAME}
BUNDLE DESTINATION ${QGIS_INSTALL_PREFIX}
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})
IF (APPLE)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND /bin/echo -n \"APPLQGIS\" OUTPUT_FILE \"$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/../PkgInfo\")")
ENDIF (APPLE)