-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathCMakeLists.txt
725 lines (634 loc) · 21.8 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
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
add_subdirectory(../../external/libdxfrw dwg/libdxfrw)
if(NOT WIN32)
SUBDIRS(${CMAKE_SOURCE_DIR}/external/qt-unix-signals)
endif()
set(QGIS_APP_SRCS
${CMAKE_SOURCE_DIR}/external/nmea/gmath.c
${CMAKE_SOURCE_DIR}/external/nmea/time.c
qgisapp.cpp
qgisappinterface.cpp
qgisappstylesheet.cpp
qgsabout.cpp
qgsappauthrequesthandler.cpp
qgsappbrowserproviders.cpp
qgsappcoordinateoperationhandlers.cpp
qgsapplayertreeviewmenuprovider.cpp
qgsappwindowmanager.cpp
qgsappscreenshots.cpp
qgsanimationexportdialog.cpp
qgsannotationwidget.cpp
qgsappsslerrorhandler.cpp
qgsattributetabledialog.cpp
qgsbookmarks.cpp
qgsbookmarkeditordialog.cpp
qgsclipboard.cpp
qgscustomization.cpp
qgsdatumtransformtablewidget.cpp
qgsdevtoolspanelwidget.cpp
qgsdiscoverrelationsdialog.cpp
qgsdxfexportdialog.cpp
qgselevationshadingrenderersettingswidget.cpp
qgsformannotationdialog.cpp
qgsguivectorlayertools.cpp
qgshtmlannotationdialog.cpp
qgsdelattrdialog.cpp
qgsdisplayangle.cpp
qgsfirstrundialog.cpp
qgsfixattributedialog.cpp
qgsgeometryvalidationservice.cpp
qgsgeometryvalidationdock.cpp
qgsgeometryvalidationmodel.cpp
qgsidentifyresultsdialog.cpp
qgsfeatureaction.cpp
qgslayercapabilitiesmodel.cpp
qgslayernotesmanager.cpp
qgslayertreegrouppropertieswidget.cpp
qgslayertreeviewindicatorprovider.cpp
qgslayertreeviewembeddedindicator.cpp
qgslayertreeviewfilterindicator.cpp
qgslayertreeviewlowaccuracyindicator.cpp
qgslayertreeviewmemoryindicator.cpp
qgslayertreeviewnocrsindicator.cpp
qgslayertreeviewnonremovableindicator.cpp
qgslayertreeviewnotesindicator.cpp
qgslayertreeviewbadlayerindicator.cpp
qgslayertreeviewtemporalindicator.cpp
qgslayertreeviewofflineindicator.cpp
qgsmapcanvasdockwidget.cpp
qgsmapsavedialog.cpp
qgsprojectlistitemdelegate.cpp
qgspuzzlewidget.cpp
qgsversionmigration.cpp
qgsrasterattributetableapputils.cpp
qgssnappinglayertreemodel.cpp
qgssnappingwidget.cpp
qgsstatusbarcoordinateswidget.cpp
qgsstatusbarmagnifierwidget.cpp
qgsstatusbarscalewidget.cpp
qgstemplateprojectsmodel.cpp
qgstemporalcontrollerdockwidget.cpp
qgsversioninfo.cpp
qgsrecentprojectsitemsmodel.cpp
qgsrecentprojectsmenueventfilter.cpp
qgsvectorlayerdigitizingproperties.cpp
qgswelcomepage.cpp
qgsmaptooladdfeature.cpp
qgsmaptooladdpart.cpp
qgsmaptooladdring.cpp
qgsmaptoolfillring.cpp
qgsmaptoolannotation.cpp
qgsmaptooldeletering.cpp
qgsmaptooldeletepart.cpp
qgsmaptooltrimextendfeature.cpp
qgsmaptoolfeatureaction.cpp
qgsmaptoolformannotation.cpp
qgsmaptoolhtmlannotation.cpp
qgsmaptoolidentifyaction.cpp
qgsmaptoolmeasureangle.cpp
qgsmaptoolmeasurebearing.cpp
qgsmaptoolmovefeature.cpp
qgsmaptooloffsetcurve.cpp
qgsmaptooloffsetpointsymbol.cpp
qgsmaptoolpointsymbol.cpp
qgsmaptoolreshape.cpp
qgsmaptoolreverseline.cpp
qgsmaptoolrotatefeature.cpp
qgsmaptoolrotatepointsymbols.cpp
qgsmaptoolscalefeature.cpp
qgsmaptoolselect.cpp
qgsmaptoolselectionhandler.cpp
qgsmaptoolselectutils.cpp
qgsmaptoolsimplify.cpp
qgsmaptoolsplitfeatures.cpp
qgsmaptoolsplitparts.cpp
annotations/qgsannotationitempropertieswidget.cpp
annotations/qgsannotationlayerproperties.cpp
canvas/qgsappcanvasfiltering.cpp
canvas/qgscanvasrefreshblocker.cpp
decorations/qgsdecorationitem.cpp
decorations/qgsdecorationtitle.cpp
decorations/qgsdecorationtitledialog.cpp
decorations/qgsdecorationcopyright.cpp
decorations/qgsdecorationcopyrightdialog.cpp
decorations/qgsdecorationimage.cpp
decorations/qgsdecorationimagedialog.cpp
decorations/qgsdecorationlayoutextent.cpp
decorations/qgsdecorationlayoutextentdialog.cpp
decorations/qgsdecorationnortharrow.cpp
decorations/qgsdecorationnortharrowdialog.cpp
decorations/qgsdecorationscalebar.cpp
decorations/qgsdecorationscalebardialog.cpp
decorations/qgsdecorationgrid.cpp
decorations/qgsdecorationgriddialog.cpp
decorations/qgsdecorationoverlay.cpp
pointcloud/qgspointcloudelevationpropertieswidget.cpp
pointcloud/qgspointcloudlayerproperties.cpp
pointcloud/qgspointcloudlayerstylewidget.cpp
raster/qgsrasterelevationpropertieswidget.cpp
tiledscene/qgstiledsceneelevationpropertieswidget.cpp
tiledscene/qgstiledscenelayerproperties.cpp
tiledscene/qgstiledscenelayerstylewidget.cpp
vertextool/qgslockedfeature.cpp
vertextool/qgsvertexeditor.cpp
vertextool/qgsvertextool.cpp
qgslayerstylingwidget.cpp
qgsmeasuredialog.cpp
qgsmeasuretool.cpp
qgsmergeattributesdialog.cpp
qgspointmarkeritem.cpp
qgspointrotationitem.cpp
qgspluginmetadata.cpp
qgspluginregistry.cpp
qgsprojectlayergroupdialog.cpp
qgsprojectproperties.cpp
qgsrastercalcdialog.cpp
qgsrelationmanagerdialog.cpp
qgsrelationadddlg.cpp
qgsrelationaddpolymorphicdialog.cpp
qgsselectbyformdialog.cpp
qgsstatisticalsummarydockwidget.cpp
qgstextannotationdialog.cpp
qgssvgannotationdialog.cpp
qgsundowidget.cpp
qgsmapthemes.cpp
qgshandlebadlayers.cpp
browser/qgsinbuiltdataitemproviders.cpp
devtools/qgsappdevtoolutils.cpp
devtools/qgsdevtoolsmodelnode.cpp
devtools/networklogger/qgsnetworklogger.cpp
devtools/networklogger/qgsnetworkloggernode.cpp
devtools/networklogger/qgsnetworkloggerpanelwidget.cpp
devtools/networklogger/qgsnetworkloggerwidgetfactory.cpp
devtools/profiler/qgsprofilerpanelwidget.cpp
devtools/profiler/qgsprofilerwidgetfactory.cpp
devtools/documentation/qgsdocumentationpanelwidget.cpp
devtools/querylogger/qgsappquerylogger.cpp
devtools/querylogger/qgsdatabasequeryloggernode.cpp
devtools/querylogger/qgsqueryloggerpanelwidget.cpp
devtools/querylogger/qgsqueryloggerwidgetfactory.cpp
dwg/qgsdwgimportdialog.cpp
dwg/qgsdwgimporter.cpp
elevation/qgselevationprofileexportsettingswidget.cpp
elevation/qgselevationprofileimageexportdialog.cpp
elevation/qgselevationprofilepdfexportdialog.cpp
elevation/qgselevationprofiletoolidentify.cpp
elevation/qgselevationprofiletoolmeasure.cpp
elevation/qgselevationprofilewidget.cpp
elevation/qgsmaptoolprofilecurve.cpp
elevation/qgsmaptoolprofilecurvefromfeature.cpp
georeferencer/qgsvalidateddoublespinbox.cpp
labeling/qgslabelpropertydialog.cpp
labeling/qgsmaptoolchangelabelproperties.cpp
labeling/qgsmaptoolpinlabels.cpp
labeling/qgsmaptoolshowhidelabels.cpp
labeling/qgsmaptoollabel.cpp
labeling/qgsmaptoolmovelabel.cpp
labeling/qgsmaptoolrotatelabel.cpp
layers/qgsapplayerhandling.cpp
layout/qgslayoutappmenuprovider.cpp
layout/qgslayoutdesignerdialog.cpp
layout/qgslayoutimagedrophandler.cpp
layout/qgslayoutmanagerdialog.cpp
layout/qgsreportfieldgroupsectionwidget.cpp
layout/qgsreportlayoutsectionwidget.cpp
layout/qgsreportorganizerwidget.cpp
layout/qgsreportsectionmodel.cpp
layout/qgsreportsectionwidget.cpp
locator/qgsactionlocatorfilter.cpp
locator/qgsactivelayerfeatureslocatorfilter.cpp
locator/qgslayermetadatalocatorfilter.cpp
locator/qgsalllayersfeatureslocatorfilter.cpp
locator/qgsbookmarklocatorfilter.cpp
locator/qgsexpressioncalculatorlocatorfilter.cpp
locator/qgsgotolocatorfilter.cpp
locator/qgslayertreelocatorfilter.cpp
locator/qgslayoutlocatorfilter.cpp
locator/qgsnominatimlocatorfilter.cpp
locator/qgssettingslocatorfilter.cpp
locator/qgslocatoroptionswidget.cpp
maptools/qgsappmaptools.cpp
maptools/qgsavoidintersectionsoperation.cpp
maptools/qgsmaptoolsdigitizingtechniquemanager.cpp
maptools/qgsmaptoolshapecircleabstract.cpp
maptools/qgsmaptoolshapecircularstringabstract.cpp
maptools/qgsmaptoolshapeellipseabstract.cpp
maptools/qgsmaptoolshaperectangleabstract.cpp
maptools/qgsmaptoolshaperegularpolygonabstract.cpp
maptools/qgsmaptoolshapecircle2points.cpp
maptools/qgsmaptoolshapecircle2tangentspoint.cpp
maptools/qgsmaptoolshapecircle3points.cpp
maptools/qgsmaptoolshapecircle3tangents.cpp
maptools/qgsmaptoolshapecirclecenterpoint.cpp
maptools/qgsmaptoolshapecircularstringradius.cpp
maptools/qgsmaptoolshapeellipsecenter2points.cpp
maptools/qgsmaptoolshapeellipsecenterpoint.cpp
maptools/qgsmaptoolshapeellipseextent.cpp
maptools/qgsmaptoolshapeellipsefoci.cpp
maptools/qgsmaptoolshaperectangle3points.cpp
maptools/qgsmaptoolshaperectanglecenter.cpp
maptools/qgsmaptoolshaperectangleextent.cpp
maptools/qgsmaptoolshaperegularpolygon2points.cpp
maptools/qgsmaptoolshaperegularpolygoncentercorner.cpp
maptools/qgsmaptoolshaperegularpolygoncenterpoint.cpp
options/qgsadvancedoptions.cpp
options/qgscodeeditoroptions.cpp
options/qgscustomprojectionoptions.cpp
options/qgselevationoptions.cpp
options/qgsfontoptions.cpp
options/qgsgpsdeviceoptions.cpp
options/qgsgpsoptions.cpp
options/qgsideoptions.cpp
options/qgsoptions.cpp
options/qgsoptionsutils.cpp
options/qgsrasterrenderingoptions.cpp
options/qgsrenderingoptions.cpp
options/qgsvectorrenderingoptions.cpp
options/qgsuserprofileoptions.cpp
options/qgsuserprofileselectiondialog.cpp
gps/qgsappgpsconnection.cpp
gps/qgsappgpsdigitizing.cpp
gps/qgsappgpslogging.cpp
gps/qgsappgpssettingsmenu.cpp
gps/qgsgpsbearingitem.cpp
gps/qgsgpscanvasbridge.cpp
gps/qgsgpsinformationwidget.cpp
gps/qgsgpsmarker.cpp
gps/qgsgpstoolbar.cpp
sensor/qgssensortablewidget.cpp
sensor/qgsprojectsensorsettingswidget.cpp
project/qgsprojectelevationsettingswidget.cpp
pluginmanager/qgspluginmanager.cpp
pluginmanager/qgspluginmanager_texts.cpp
pluginmanager/qgsapppluginmanagerinterface.cpp
pluginmanager/qgspluginsortfilterproxymodel.cpp
pluginmanager/qgspluginitemdelegate.cpp
qgssettingstreewidgetold.cpp
qgssettingsregistryapp.cpp
qgsvariantdelegate.cpp
qgscrashhandler.cpp
mesh/qgsmeshcalculatordialog.cpp
mesh/qgsnewmeshlayerdialog.cpp
mesh/qgsmaptooleditmeshframe.cpp
mesh/qgsmeshelevationpropertieswidget.cpp
mesh/qgsmeshtransformcoordinatesdockwidget.cpp
mesh/qgsmeshselectbyexpressiondialog.cpp
vector/qgsvectorelevationpropertieswidget.cpp
)
if (WITH_SPATIALITE)
set(QGIS_APP_SRCS
${QGIS_APP_SRCS}
qgsnewspatialitelayerdialog.cpp
)
endif()
if (HAVE_GEOREFERENCER)
set(QGIS_APP_SRCS
${QGIS_APP_SRCS}
georeferencer/qgsgcpcanvasitem.cpp
georeferencer/qgsgeorefconfigdialog.cpp
georeferencer/qgsgeorefdatapoint.cpp
georeferencer/qgsgeorefdelegates.cpp
georeferencer/qgsgeorefmainwindow.cpp
georeferencer/qgsgeoreftooladdpoint.cpp
georeferencer/qgsgeoreftooldeletepoint.cpp
georeferencer/qgsgeoreftoolmovepoint.cpp
georeferencer/qgsgeorefvalidators.cpp
georeferencer/qgsmapcoordsdialog.cpp
georeferencer/qgsresidualplotitem.cpp
georeferencer/qgstransformsettingsdialog.cpp
georeferencer/qgsgcplist.cpp
georeferencer/qgsgcplistmodel.cpp
georeferencer/qgsimagewarper.cpp
georeferencer/qgsgeoreftransform.cpp
georeferencer/qgsgcplistwidget.cpp
georeferencer/qgsrasterchangecoords.cpp
)
endif()
if (WITH_3D)
set(QGIS_APP_SRCS
${QGIS_APP_SRCS}
3d/qgs3danimationwidget.cpp
3d/qgs3danimationexportdialog.cpp
3d/qgs3dapputils.cpp
3d/qgs3dicongenerator.cpp
3d/qgs3dmapconfigwidget.cpp
3d/qgs3dmaptoolidentify.cpp
3d/qgs3dmaptoolmeasureline.cpp
3d/qgs3dmeasuredialog.cpp
3d/qgs3dmodelsourcelineedit.cpp
3d/qgs3dnavigationwidget.cpp
3d/qgs3doptions.cpp
3d/qgsgoochmaterialwidget.cpp
3d/qgslightswidget.cpp
3d/qgsline3dsymbolwidget.cpp
3d/qgsmaterialwidget.cpp
3d/qgsmesh3dsymbolwidget.cpp
3d/qgsmetalroughmaterialwidget.cpp
3d/qgsnullmaterialwidget.cpp
3d/qgspoint3dsymbolwidget.cpp
3d/qgspolygon3dsymbolwidget.cpp
3d/qgsphongmaterialwidget.cpp
3d/qgsphongtexturedmaterialwidget.cpp
3d/qgsrulebased3drendererwidget.cpp
3d/qgssimplelinematerialwidget.cpp
3d/qgssymbol3dwidget.cpp
3d/qgstiledscenelayer3drendererwidget.cpp
3d/qgsvectorlayer3dpropertieswidget.cpp
3d/qgsvectorlayer3drendererwidget.cpp
3d/qgsmeshlayer3drendererwidget.cpp
3d/qgsmap3dexportwidget.cpp
layout/qgslayout3dmapwidget.cpp
3d/qgsskyboxrenderingsettingswidget.cpp
3d/qgsshadowrenderingsettingswidget.cpp
3d/qgsambientocclusionsettingswidget.cpp
3d/qgspointcloud3dsymbolwidget.cpp
3d/qgspointcloudlayer3drendererwidget.cpp
3d/qgs3dmapcanvaswidget.cpp
3d/qgs3dviewsmanagerdialog.cpp
3d/qgs3ddebugwidget.cpp
)
endif()
find_package(${QT_VERSION_BASE} COMPONENTS UiTools REQUIRED)
set (WITH_QWTPOLAR FALSE CACHE BOOL "Determines whether QwtPolar is available or whether functionality requiring QwtPolar should be disabled.")
# Once we bump the minimum QWT VERSION to 6.2 or newer, we should get rid of WITH_QWTPOLAR
if(QWT_VERSION_STR VERSION_GREATER_EQUAL 6.2 OR WITH_QWTPOLAR)
add_definitions(-DWITH_QWTPOLAR)
if(QWT_VERSION_STR VERSION_LESS 6.2)
find_package(QwtPolar REQUIRED)
else()
set(FOUND_QwtPolar TRUE)
set(QWTPOLAR_LIBRARY ${QWT_LIBRARY})
set(QWTPOLAR_INCLUDE_DIR ${QWT_INCLUDE_DIR})
add_definitions(-DQWT_POLAR_VERSION=0x060200)
endif()
# If not found on the system, offer the possibility to build QwtPolar
# internally
if(NOT FOUND_QwtPolar)
set(DEFAULT_WITH_INTERNAL_QWTPOLAR TRUE)
else()
set(DEFAULT_WITH_INTERNAL_QWTPOLAR FALSE)
endif()
set (WITH_INTERNAL_QWTPOLAR ${DEFAULT_WITH_INTERNAL_QWTPOLAR} CACHE BOOL "Use internal build of QwtPolar")
if(WITH_INTERNAL_QWTPOLAR)
set(QGIS_APP_SRCS
${QGIS_APP_SRCS}
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_canvas.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_curve.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_fitter.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_grid.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_item.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_itemdict.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_layout.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_magnifier.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_marker.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_panner.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_picker.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_plot.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_renderer.cpp
${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1/qwt_polar_spectrogram.cpp
)
set(QWTPOLAR_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/external/qwtpolar-1.1.1)
set(QWTPOLAR_LIBRARY "")
endif()
else()
set(QWTPOLAR_LIBRARY "")
set(QWTPOLAR_INCLUDE_DIR "")
endif()
if (POSTGRES_FOUND)
if(HAVE_PGCONFIG)
add_definitions(-DHAVE_PGCONFIG=1)
endif()
endif()
# Test data dir for QgsAppScreenShots
add_definitions(-DTEST_DATA_DIR="${TEST_DATA_DIR}")
# add test resources, e.g. standard test font
set(TEST_RCCS ../../tests/testdata/testdata.qrc)
if (WIN32)
set (QGIS_APP_SRCS ${QGIS_APP_SRCS} main.cpp ${TEST_RCCS})
set (QGIS_APPMAIN_SRCS mainwin.cpp)
if (NOT MSVC)
enable_language(RC)
set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
set(QGIS_RC_LIBS -mwindows)
endif()
set (QGIS_APPMAIN_SRCS ${QGIS_APPMAIN_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)
else()
set (QGIS_APPMAIN_SRCS main.cpp ${TEST_RCCS})
endif()
if(PEDANTIC)
# disable deprecation warnings
if(MSVC)
set_source_files_properties(
qgisappinterface.cpp
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "/wd4996"
)
else()
set_source_files_properties(
qgisappinterface.cpp
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations"
)
endif()
endif()
if(MSVC)
# -wd4091 Avoid 'typedef' ignored on left of '' when no variable is declared warning in dbghelp.h
set_source_files_properties(
qgisapp.cpp
main.cpp
qgscrashhandler.cpp
PROPERTIES COMPILE_FLAGS -wd4091
)
set_source_files_properties(
qgisapp.cpp
PROPERTIES COMPILE_FLAGS "/bigobj"
)
elseif(MINGW)
set_source_files_properties(
qgisapp.cpp
PROPERTIES COMPILE_FLAGS "-Wa,-mbig-obj"
)
endif()
if(HAVE_OPENCL)
include_directories(SYSTEM ${OpenCL_INCLUDE_DIRS})
endif()
if(ENABLE_MODELTEST)
include_directories(../../tests/qt_modeltest)
endif()
if (ANDROID)
include_directories(SYSTEM ${ANDROID_NDK_TOOLCHAIN_ROOT}/sysroot/usr/include)
endif()
if (APPLE)
include_directories(${CMAKE_SOURCE_DIR}/src/native/mac)
endif()
if (POSTGRES_FOUND)
include_directories(SYSTEM ${POSTGRES_INCLUDE_DIR})
endif()
#############
if (ANDROID)
add_library(${QGIS_APP_NAME} ${LIBRARY_TYPE} ${QGIS_APPMAIN_SRCS})
# require c++17
target_compile_features(${QGIS_APP_NAME} PRIVATE cxx_std_17)
else()
if(APPLE)
set (CREATE_MACOSX_BUNDLE TRUE CACHE BOOL "Create macosx bundle during build. Disable for development to avoid copying libraries and ease debugging.")
if(CREATE_MACOSX_BUNDLE)
set(MACOSX_BUNDLE "MACOSX_BUNDLE")
endif()
endif()
add_executable(${QGIS_APP_NAME} ${MACOSX_BUNDLE} WIN32 ${QGIS_APPMAIN_SRCS})
if(WIN32 AND BUILD_WITH_QT6)
qt_disable_unicode_defines(${QGIS_APP_NAME})
endif()
# require c++17
target_compile_features(${QGIS_APP_NAME} PRIVATE cxx_std_17)
target_compile_definitions(${QGIS_APP_NAME} PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"")
endif()
# Putting IMAGE_RCC_SRCS into qgis_app lib is causing problems when the lib is
# loaded (by plugin for example) in test unit (qgis_layoutpicturetest).
add_library(qgis_app ${LIBRARY_TYPE} ${QGIS_APP_SRCS})
# require c++17
target_compile_features(qgis_app PRIVATE cxx_std_17)
target_compile_definitions(qgis_app PRIVATE "QT_PLUGINS_DIR=\"${QT_PLUGINS_DIR}\"")
target_include_directories(qgis_app PUBLIC
${CMAKE_SOURCE_DIR}/external/nmea
${CMAKE_SOURCE_DIR}/src/app
${CMAKE_SOURCE_DIR}/src/app/decorations
${CMAKE_SOURCE_DIR}/src/app/devtools
${CMAKE_SOURCE_DIR}/src/app/devtools/networklogger
${CMAKE_SOURCE_DIR}/src/app/georeferencer
${CMAKE_SOURCE_DIR}/src/app/labeling
${CMAKE_SOURCE_DIR}/src/app/layout
${CMAKE_SOURCE_DIR}/src/app/pluginmanager
${CMAKE_SOURCE_DIR}/src/app/gps
${CMAKE_SOURCE_DIR}/src/app/sensor
${CMAKE_SOURCE_DIR}/src/app/dwg
${CMAKE_SOURCE_DIR}/src/app/maptools
${CMAKE_SOURCE_DIR}/src/app/mesh
${CMAKE_SOURCE_DIR}/src/app/locator
${CMAKE_SOURCE_DIR}/src/app/options
${CMAKE_SOURCE_DIR}/src/app/pointcloud
${CMAKE_SOURCE_DIR}/src/app/settings
${CMAKE_SOURCE_DIR}/src/app/tiledscene
${CMAKE_SOURCE_DIR}/src/app/vectortile
${CMAKE_SOURCE_DIR}/src/plugins
${CMAKE_SOURCE_DIR}/src/python
${CMAKE_SOURCE_DIR}/src/native
${CMAKE_BINARY_DIR}/src/app
)
if (WITH_3D)
target_include_directories(qgis_app PUBLIC
${CMAKE_SOURCE_DIR}/src/app/3d
)
endif()
target_include_directories(qgis_app SYSTEM PUBLIC
${QT_QTUITOOLS_INCLUDE_DIR}
${QWTPOLAR_INCLUDE_DIR}
${CMAKE_SOURCE_DIR}/external/qt-unix-signals
)
add_dependencies(qgis_gui ui)
target_link_libraries(qgis_app
${QWT_LIBRARY}
${QWTPOLAR_LIBRARY}
${QT_VERSION_BASE}::Sql
${QT_VERSION_BASE}::UiTools
${OPTIONAL_QTWEBKIT}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
${QGIS_RC_LIBS}
qgis_core
qgis_gui
qgis_analysis
qgis_native
libdxfrw
)
target_compile_definitions(qgis_app PRIVATE "-DQT_NO_FOREACH")
if (USE_PRECOMPILED_HEADERS)
target_precompile_headers(qgis_app PRIVATE $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_SOURCE_DIR}/src/core/qgis.h>)
endif()
set_target_properties(qgis_app PROPERTIES UNITY_BUILD ${ENABLE_UNITY_BUILDS})
if (WITH_BINDINGS)
add_definitions(-DWITH_BINDINGS)
target_link_libraries(qgis_app qgispython)
endif()
if(ENABLE_MODELTEST)
target_link_libraries(qgis_app ${QT_VERSION_BASE}::Test)
endif()
if (WITH_3D)
target_link_libraries(qgis_app qgis_3d)
endif()
GENERATE_EXPORT_HEADER(
qgis_app
BASE_NAME APP
EXPORT_FILE_NAME qgis_app.h
)
if (NOT ANDROID)
set_target_properties(qgis_app PROPERTIES
VERSION ${COMPLETE_VERSION}
SOVERSION ${COMPLETE_VERSION}
)
endif()
if (APPLE)
target_link_libraries(qgis_app ${APP_SERVICES_LIBRARY})
endif()
if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
set_target_properties(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
endif()
# clang-tidy
if(CLANG_TIDY_EXE)
set_target_properties(
qgis_app PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
if(NOT WIN32)
target_link_libraries(${QGIS_APP_NAME} qgis_app)
endif()
if (ANDROID)
target_link_libraries(${QGIS_APP_NAME} log)
endif()
if(WIN32)
add_definitions(-DQWT_DLL)
add_definitions(-DQSCINTILLA_DLL)
target_link_libraries(${QGIS_APP_NAME} dbghelp)
target_link_libraries(qgis_app dbghelp)
endif()
target_link_libraries(${QGIS_APP_NAME} qgis_native)
if (NOT WIN32)
target_link_libraries(${QGIS_APP_NAME} QTSignal)
endif()
if (APPLE)
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()
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
find_library(EXECINFO_LIBRARY NAMES execinfo)
target_link_libraries(${QGIS_APP_NAME} ${EXECINFO_LIBRARY})
endif()
if (POSTGRES_FOUND)
target_link_libraries (qgis_app ${POSTGRES_LIBRARY})
endif()
if (WITH_PDAL)
target_link_libraries(qgis_app ${PDAL_LIBRARIES})
endif()
if(MSVC)
install(FILES qgis.ico qgis-mime.ico qgis-qgs.ico qgis-qlr.ico qgis-qml.ico qgis-qpt.ico DESTINATION icons)
endif()
install(TARGETS qgis_app
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})
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()