CMakeLists.txt 20.3 KB
Newer Older
Torsten Rahn's avatar
Torsten Rahn committed
1
PROJECT(marblewidget)
2

3
4
5
6
7
8
9
10
macro_optional_find_package(Phonon4Qt5 QUIET)
marble_set_package_properties( Phonon4Qt5 PROPERTIES
    DESCRIPTION "Qt-based audio library"
    URL "https://phonon.kde.org/"
    PURPOSE "Support for playback of soundcue elements"
    TYPE OPTIONAL
)
if(Phonon4Qt5_FOUND)
11
12
    set(HAVE_PHONON TRUE)
endif()
13
14
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config-phonon.h.cmake
               ${CMAKE_CURRENT_BINARY_DIR}/config-phonon.h)
Torsten Rahn's avatar
Torsten Rahn committed
15

16
17
18
19
if(MARBLE_NO_WEBKITWIDGETS)
    add_definitions(-DMARBLE_NO_WEBKITWIDGETS)
endif()

Torsten Rahn's avatar
Torsten Rahn committed
20
INCLUDE_DIRECTORIES(
21
22
 ${CMAKE_CURRENT_SOURCE_DIR}
 ${CMAKE_CURRENT_BINARY_DIR}
23
 ${CMAKE_CURRENT_SOURCE_DIR}/projections
24
 ${CMAKE_CURRENT_SOURCE_DIR}/routing
Tobias Koenig's avatar
Tobias Koenig committed
25
26
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/data
27
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/graphicsitem
Torsten Rahn's avatar
Torsten Rahn committed
28
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/scene
29
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/handlers
Tobias Koenig's avatar
Tobias Koenig committed
30
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/handlers/kml
Torsten Rahn's avatar
Torsten Rahn committed
31
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/handlers/dgml
Tobias Koenig's avatar
Tobias Koenig committed
32
 ${CMAKE_CURRENT_SOURCE_DIR}/geodata/parser
33
 ${CMAKE_CURRENT_SOURCE_DIR}/graphicsview
34
 ${CMAKE_CURRENT_SOURCE_DIR}/layers
35
 ${CMAKE_CURRENT_SOURCE_DIR}/osm
36
 ${CMAKE_CURRENT_SOURCE_DIR}/cloudsync
37
 ${CMAKE_SOURCE_DIR}/src/lib/astro
38
 ${ZLIB_INCLUDE_DIRS}
Michael Zanetti's avatar
Michael Zanetti committed
39
40
)

Torsten Rahn's avatar
   
Torsten Rahn committed
41
INCLUDE(geodata/CMakeLists.txt)
42
INCLUDE(graphicsview/CMakeLists.txt)
43
INCLUDE(layers/CMakeLists.txt)
44
INCLUDE(osm/CMakeLists.txt)
Tobias Koenig's avatar
Tobias Koenig committed
45

46
47
set(MARBLE_LIB_VERSION_MAJOR "21")
set(MARBLE_LIB_VERSION_MINOR "4")
48
set(MARBLE_LIB_VERSION_PATCH "0")
49
set(MARBLE_LIB_VERSION "${MARBLE_LIB_VERSION_MAJOR}.${MARBLE_LIB_VERSION_MINOR}.${MARBLE_LIB_VERSION_PATCH}")
50
set(MARBLE_ABI_VERSION "28")
Torsten Rahn's avatar
Torsten Rahn committed
51
52
53
54

########### next target ###############

set(marblewidget_SRCS
Torsten Rahn's avatar
Torsten Rahn committed
55
    ${geodata_SRCS}
56
    ${graphicsview_SRCS}
57
    ${layers_SRCS}
58
    ${osm_SRCS}
59
60
61
62
    blendings/Blending.cpp
    blendings/BlendingAlgorithms.cpp
    blendings/BlendingFactory.cpp
    blendings/SunLightBlending.cpp
63
    DownloadRegion.cpp
64
65
    DownloadRegionDialog.cpp
    LatLonBoxWidget.cpp
Torsten Rahn's avatar
Torsten Rahn committed
66
    MarbleWidget.cpp
67
    MarbleAbstractPresenter.cpp
Torsten Rahn's avatar
Torsten Rahn committed
68
69
    MarbleModel.cpp
    MarbleMap.cpp
70
    MarbleColors.cpp
71
    MapViewWidget.cpp
72
    CelestialSortFilterProxyModel.cpp
73
    FileViewWidget.cpp
Mihail Ivchenko's avatar
Mihail Ivchenko committed
74
    TourWidget.cpp
75
76
77
78
    FlyToEditWidget.cpp
    TourControlEditWidget.cpp
    WaitEditWidget.cpp
    SoundCueEditWidget.cpp
Mihail Ivchenko's avatar
Mihail Ivchenko committed
79
    RemoveItemEditWidget.cpp
80
    TourItemDelegate.cpp
81
    MapViewItemDelegate.cpp
Illya Kovalevskyy's avatar
Illya Kovalevskyy committed
82
    TourPlayback.cpp
83
    LegendWidget.cpp
Sanjiban Bairagya's avatar
Sanjiban Bairagya committed
84
85
86
87
88
89
90
    PlaybackItem.cpp
    PlaybackAnimatedUpdateItem.cpp
    PlaybackFlyToItem.cpp
    PlaybackSoundCueItem.cpp
    PlaybackTourControlItem.cpp
    PlaybackWaitItem.cpp
    SerialTrack.cpp
91
92
    SoundTrack.cpp
    AnimatedUpdateTrack.cpp
93
    CurrentLocationWidget.cpp
Torsten Rahn's avatar
Torsten Rahn committed
94
95
96
    MarbleNavigator.cpp
    MarbleLegendBrowser.cpp
    MarbleAboutDialog.cpp
97
    MarbleInputHandler.cpp
Torsten Rahn's avatar
Torsten Rahn committed
98
99
100
    MarbleWidgetInputHandler.cpp
    MarbleWidgetPopupMenu.cpp
    MarblePlacemarkModel.cpp
101
    GeoDataTreeModel.cpp
Levente Kurusa's avatar
Levente Kurusa committed
102
    GeoUriParser.cpp
103
    kdescendantsproxymodel.cpp
104
    BranchFilterProxyModel.cpp
105
    TreeViewDecoratorModel.cpp
106
    MarbleDebug.cpp
Ander Pijoan's avatar
Ander Pijoan committed
107
    Tile.cpp
108
    TextureTile.cpp
109
110
    TileCoordsPyramid.cpp
    TileLevelRangeWidget.cpp
111
    TileLoader.cpp
112
    QtMarbleConfigDialog.cpp
Torsten Rahn's avatar
Torsten Rahn committed
113
    ClipPainter.cpp
114
115
    DownloadPolicy.cpp
    DownloadQueueSet.cpp
116
    GeoPainter.cpp
Torsten Rahn's avatar
Torsten Rahn committed
117
    HttpDownloadManager.cpp
118
    HttpJob.cpp
119
    RemoteIconLoader.cpp
Torsten Rahn's avatar
Torsten Rahn committed
120
121
    LayerManager.cpp
    PluginManager.cpp
Bastian Holst's avatar
Bastian Holst committed
122
    TimeControlWidget.cpp
123
    AbstractFloatItem.cpp
124
    PopupItem.cpp
125
    MarbleGlobal.cpp
Torsten Rahn's avatar
Torsten Rahn committed
126
    MarbleDirs.cpp
Torsten Rahn's avatar
Torsten Rahn committed
127
    MarbleLocale.cpp
Torsten Rahn's avatar
Torsten Rahn committed
128
    MarblePhysics.cpp
Torsten Rahn's avatar
Torsten Rahn committed
129
130
131
132
    TileCreatorDialog.cpp
    MapThemeManager.cpp
    ViewportParams.cpp
    ViewParams.cpp
133
    projections/AbstractProjection.cpp
134
    projections/CylindricalProjection.cpp
Gábor Péterffy's avatar
Gábor Péterffy committed
135
    projections/AzimuthalProjection.cpp
136
137
138
    projections/SphericalProjection.cpp
    projections/EquirectProjection.cpp
    projections/MercatorProjection.cpp
Gábor Péterffy's avatar
Gábor Péterffy committed
139
    projections/GnomonicProjection.cpp
140
    projections/StereographicProjection.cpp
141
    projections/LambertAzimuthalProjection.cpp
142
    projections/AzimuthalEquidistantProjection.cpp
143
    projections/VerticalPerspectiveProjection.cpp
144
    VisiblePlacemark.cpp
145
    PlacemarkLayout.cpp
Henry de Valence's avatar
Henry de Valence committed
146
    Planet.cpp
147
    PlanetFactory.cpp
Torsten Rahn's avatar
Torsten Rahn committed
148
149
    Quaternion.cpp
    TextureColorizer.cpp
150
151
    TextureMapperInterface.cpp
    ScanlineTextureMapperContext.cpp
152
153
    SphericalScanlineTextureMapper.cpp
    EquirectScanlineTextureMapper.cpp
154
    MercatorScanlineTextureMapper.cpp
155
    TileScalingTextureMapper.cpp
156
    GenericScanlineTextureMapper.cpp
157
    VectorTileModel.cpp
Torsten Rahn's avatar
Torsten Rahn committed
158
    DiscCache.cpp
159
    ServerLayout.cpp
160
    StoragePolicy.cpp
Torsten Rahn's avatar
Torsten Rahn committed
161
162
    CacheStoragePolicy.cpp
    FileStoragePolicy.cpp
163
    FileStorageWatcher.cpp
164
    StackedTile.cpp
165
    TileId.cpp
166
    StackedTileLoader.cpp
167
    TileLoaderHelper.cpp
Torsten Rahn's avatar
Torsten Rahn committed
168
    TileCreator.cpp
169
    #jsonparser.cpp
170
171
    FileLoader.cpp
    FileManager.cpp
172
    PositionTracking.cpp
173
    DataMigration.cpp
174
    ImageF.cpp
175
176
    MovieCapture.cpp
    MovieCaptureDialog.cpp
177
    TourCaptureDialog.cpp
178
    EditPlacemarkDialog.cpp
179
    AddLinkDialog.cpp
180
    FormattedTextWidget.cpp
Torsten Rahn's avatar
   
Torsten Rahn committed
181

182
183
    AbstractDataPlugin.cpp
    AbstractDataPluginModel.cpp
Bastian Holst's avatar
Bastian Holst committed
184
    AbstractDataPluginItem.cpp
185
    AbstractWorkerThread.cpp
Torsten Rahn's avatar
   
Torsten Rahn committed
186

187
    PluginInterface.cpp
188
    DialogConfigurationInterface.cpp
Dennis Nienhüser's avatar
Dennis Nienhüser committed
189
    LayerInterface.cpp
190
    RenderState.cpp
191
192
    RenderPlugin.cpp
    RenderPluginInterface.cpp
193
194
    PositionProviderPlugin.cpp
    PositionProviderPluginInterface.cpp
195
196
    PlacemarkPositionProviderPlugin.cpp
    RouteSimulationPositionProviderPlugin.cpp
197
    MarblePluginSettingsWidget.cpp
198
    RenderPluginModel.cpp
199
    PluginAboutDialog.cpp
200
    PluginItemDelegate.cpp
201

Torsten Rahn's avatar
Torsten Rahn committed
202
    SunLocator.cpp
Bastian Holst's avatar
Bastian Holst committed
203
    MarbleClock.cpp
Torsten Rahn's avatar
Torsten Rahn committed
204
    SunControlWidget.cpp
Torsten Rahn's avatar
   
Torsten Rahn committed
205
    MergedLayerDecorator.cpp
Patrick Spendrin's avatar
Patrick Spendrin committed
206

207
    MathHelper.cpp
208
209

    LatLonEdit.cpp
210
    PlacemarkEditHeader.cpp
211
212

    MapThemeSortFilterProxyModel.cpp
Patrick Spendrin's avatar
Patrick Spendrin committed
213

214
215
    TemplateDocument.cpp

216
    routing/AlternativeRoutesModel.cpp
217
218
    routing/Maneuver.cpp
    routing/Route.cpp
219
    routing/RouteRequest.cpp
220
    routing/RouteSegment.cpp
221
    routing/RoutingModel.cpp
222
    routing/RoutingProfile.cpp
223
224
225
226
    routing/RoutingManager.cpp
    routing/RoutingLayer.cpp
    routing/RoutingInputWidget.cpp
    routing/RoutingWidget.cpp
227
228
229
    routing/RoutingProfilesWidget.cpp
    routing/RoutingProfilesModel.cpp
    routing/RoutingProfileSettingsDialog.cpp
230
    routing/SpeakersModel.cpp
231
    routing/VoiceNavigationModel.cpp
232
233
234
235
236
    routing/instructions/InstructionTransformation.cpp
    routing/instructions/RoutingInstruction.cpp
    routing/instructions/RoutingPoint.cpp
    routing/instructions/RoutingWaypoint.cpp
    routing/instructions/WaypointParser.cpp
237

238
239
240
241
    ParsingRunnerManager.cpp
    ReverseGeocodingRunnerManager.cpp
    RoutingRunnerManager.cpp
    SearchRunnerManager.cpp
242

243
    AutoNavigation.cpp
244

245
246
247
248
    SearchRunnerPlugin.cpp
    ReverseGeocodingRunnerPlugin.cpp
    RoutingRunnerPlugin.cpp
    ParseRunnerPlugin.cpp
249
250
251
252
    SearchRunner.cpp
    ReverseGeocodingRunner.cpp
    RoutingRunner.cpp
    ParsingRunner.cpp
253
    RunnerTask.cpp
254
255

    BookmarkManager.cpp
256
    EditBookmarkDialog.cpp
257
    BookmarkManagerDialog.cpp
258
    NewBookmarkFolderDialog.cpp
259
260

    PrintOptionsWidget.cpp
261
    ExternalEditorDialog.cpp
262
    GoToDialog.cpp
Utku Aydın's avatar
Utku Aydın committed
263
264

    MapWizard.cpp
265
    MapThemeDownloadDialog.cpp
266
    GeoGraphicsScene.cpp
267
    ElevationModel.cpp
Dennis Nienhüser's avatar
Dennis Nienhüser committed
268
269
    MarbleLineEdit.cpp
    SearchInputWidget.cpp
270
    SearchWidget.cpp
271
    kineticmodel.cpp
272
    NewstuffModel.cpp
273
    MarbleZip.cpp
274

Sergey Popov's avatar
Sergey Popov committed
275
276
    OsmcSymbol.cpp

277
    StyleBuilder.cpp
278
279
280
281
282
283
284
285
    
    cloudsync/CloudSyncManager.cpp
    cloudsync/RouteSyncManager.cpp
    cloudsync/OwncloudSyncBackend.cpp
    cloudsync/CloudRouteModel.cpp
    cloudsync/CloudRoutesDialog.cpp
    cloudsync/RouteItem.cpp
    cloudsync/RouteItemDelegate.cpp
286
287
288
    cloudsync/BookmarkSyncManager.cpp
    cloudsync/MergeItem.cpp
    cloudsync/ConflictDialog.cpp
Torsten Rahn's avatar
Torsten Rahn committed
289
290
)

Gábor Péterffy's avatar
Gábor Péterffy committed
291

292
if (MARBLE_NO_WEBKITWIDGETS)
Gábor Péterffy's avatar
Gábor Péterffy committed
293
294
295
296
297
298
299
300
301
302
303
    LIST(APPEND marblewidget_SRCS
        NullMarbleWebView.cpp
        NullTinyWebBrowser.cpp
        )
else()
    LIST(APPEND marblewidget_SRCS
        MarbleWebView.cpp
        TinyWebBrowser.cpp
        )
endif()

304
if (NOT MARBLE_NO_DBUS)
Gábor Péterffy's avatar
Gábor Péterffy committed
305
306
307
308
309
    LIST(APPEND marblewidget_SRCS
        MarbleDBusInterface.cpp
        )
endif()

310
set (marblewidget_UI
311
    ${osm_UIS}
312
    LatLonBoxWidget.ui
313
314
315
    MapViewWidget.ui
    CurrentLocationWidget.ui
    FileViewWidget.ui
Mihail Ivchenko's avatar
Mihail Ivchenko committed
316
    TourWidget.ui
317
    MarbleNavigator.ui
318
    MarbleCacheSettingsWidget.ui
Torsten Rahn's avatar
Torsten Rahn committed
319
320
    MarbleViewSettingsWidget.ui
    MarbleNavigationSettingsWidget.ui
Bastian Holst's avatar
Bastian Holst committed
321
322
    TimeControlWidget.ui
    MarbleTimeSettingsWidget.ui
Torsten Rahn's avatar
Torsten Rahn committed
323
    MarblePluginSettingsWidget.ui
324
    TileCreatorDialog.ui
325
    TileLevelRangeWidget.ui
326
    MarbleAboutDialog.ui
327
    SunControlWidget.ui
Henry de Valence's avatar
Henry de Valence committed
328
    LatLonEdit.ui
329
    PlacemarkEditHeader.ui
330
    routing/RoutingWidget.ui
331
    DataMigrationWidget.ui
332
    EditBookmarkDialog.ui
333
    BookmarkManagerDialog.ui
334
    NewBookmarkFolderDialog.ui
335
    PrintOptions.ui
336
    ExternalEditor.ui
337
    GoToDialog.ui
338
339
    routing/RoutingSettingsWidget.ui
    routing/RoutingProfileSettingsDialog.ui
Utku Aydın's avatar
Utku Aydın committed
340
    MapWizard.ui
341
    MapThemeDownloadDialog.ui
342
343
    cloudsync/CloudRoutesDialog.ui
    MarbleCloudSyncSettingsWidget.ui
344
    MovieCaptureDialog.ui
345
    TourCaptureDialog.ui
346
    EditPlacemarkDialog.ui
347
    AddLinkDialog.ui
348
    FormattedTextWidget.ui
349
    ElevationWidget.ui
Torsten Rahn's avatar
Torsten Rahn committed
350
)
351
if (MARBLE_NO_WEBKITWIDGETS)
Gábor Péterffy's avatar
Gábor Péterffy committed
352
353
354
355
356
357
358
359
360
361
    LIST(APPEND marblewidget_UI
        NullLegendWidget.ui
        NullWebPopupWidget.ui
        )
else()
    LIST(APPEND marblewidget_UI
        LegendWidget.ui
        WebPopupWidget.ui
        )
endif()
Torsten Rahn's avatar
Torsten Rahn committed
362

363
364
# FIXME: cleaner approach of src/lib/marblwidget/MarbleControlBox.* vs. marble.qrc
qt_add_resources(marblewidget_SRCS libmarble.qrc ../../apps/marble-ui/marble.qrc)
Torsten Rahn's avatar
Torsten Rahn committed
365

Michael Zanetti's avatar
Michael Zanetti committed
366
qt_wrap_ui(marblewidget_SRCS ${marblewidget_UI})
Torsten Rahn's avatar
Torsten Rahn committed
367

368
add_library(marblewidget ${marblewidget_SRCS} ${SOURCES_UI_HDRS})
369

370
generate_export_header(marblewidget BASE_NAME marble)
371
372


373
374
375
# TODO: use PUBLIC/PRIVATE everywhere instead of LINK_PUBLIC/LINK_PRIVATE
# once SailfishOS has cmake >= 2.8.12

376
# link with libastro
377
target_link_libraries(marblewidget LINK_PRIVATE astro)
Torsten Rahn's avatar
Torsten Rahn committed
378

379
# link against zlib
380
target_link_libraries(marblewidget LINK_PRIVATE ${ZLIB_LIBRARIES})
381

Torsten Rahn's avatar
Torsten Rahn committed
382
# link with release version of Qt libs
383
target_link_libraries(marblewidget
384
385
386
387
    LINK_PUBLIC
        Qt5::Xml
        Qt5::Gui
        Qt5::Widgets
388
        Qt5::Network
389
    LINK_PRIVATE
390
        Qt5::Core
391
392
393
        Qt5::Svg
        Qt5::PrintSupport
        Qt5::Concurrent
394
)
395
if (NOT MARBLE_NO_WEBKITWIDGETS)
396
    target_link_libraries(marblewidget
397
        LINK_PUBLIC
398
            Qt5::WebChannel
399
400
            Qt5::WebEngineWidgets
            Qt5::WebEngine
401
402
    )
endif ()
403
if (NOT MARBLE_NO_DBUS)
404
    target_link_libraries(marblewidget
405
406
407
408
        LINK_PRIVATE
            Qt5::DBus
    )
endif ()
409
if (Phonon4Qt5_FOUND)
410
    target_link_libraries(marblewidget
411
        LINK_PRIVATE
412
            Phonon::phonon4qt5
413
414
    )
endif()
415

Torsten Rahn's avatar
   
Torsten Rahn committed
416
if (APPLE)
417
  # TODO: PUBLIC or can be PRIVATE?
Torsten Rahn's avatar
   
Torsten Rahn committed
418
  #defined in top level makefile
419
  target_link_libraries(marblewidget LINK_PUBLIC ${MAC_EXTRA_LIBS} )
Torsten Rahn's avatar
   
Torsten Rahn committed
420
421
endif (APPLE)

422
# TODO: still supported?
423
if (CMAKE_SYSTEM_NAME MATCHES "SunOS")
424
  target_link_libraries(marblewidget LINK_PUBLIC m)
425
426
endif (CMAKE_SYSTEM_NAME MATCHES "SunOS")

Torsten Rahn's avatar
Torsten Rahn committed
427
if(WIN32)
428
  # TODO: PUBLIC or can be PRIVATE?
429
  target_link_libraries(marblewidget LINK_PUBLIC ws2_32 imm32 winmm)
Torsten Rahn's avatar
Torsten Rahn committed
430
431
endif(WIN32)

432
set_target_properties(marblewidget  PROPERTIES
433
    EXPORT_NAME "Marble"
434
    OUTPUT_NAME marblewidget-qt5
435
436
437
    COMPILE_FLAGS "-DKML_LAZY_IMP"
)

438
439
440
441
442
443
444
if (NOT (CMAKE_SYSTEM_NAME STREQUAL Android))
  set_target_properties(marblewidget  PROPERTIES
    VERSION ${MARBLE_LIB_VERSION}
    SOVERSION ${MARBLE_ABI_VERSION}
  )
endif()

445
target_include_directories(marblewidget
446
    INTERFACE "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>"
447
)
448

Torsten Rahn's avatar
   
Torsten Rahn committed
449
# choose the correct target install library path
Dennis Nienhüser's avatar
Dennis Nienhüser committed
450
if(WIN32)
451
  install(TARGETS marblewidget EXPORT MarbleTargets RUNTIME DESTINATION bin ARCHIVE DESTINATION lib)
Dennis Nienhüser's avatar
Dennis Nienhüser committed
452
elseif(APPLE)
453
  install(TARGETS marblewidget LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib)
Dennis Nienhüser's avatar
Dennis Nienhüser committed
454
else()
455
  install(TARGETS marblewidget
456
    EXPORT MarbleTargets
457
458
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
Dennis Nienhüser's avatar
Dennis Nienhüser committed
459
460
endif()

Torsten Rahn's avatar
Torsten Rahn committed
461

462
463
########### install headers & cmake config files ###############

464
if (APPLE)
465
466
467
    # TODO: find how to install & deploy library, headers and config files as bundle for development
    return()
endif()
Torsten Rahn's avatar
Torsten Rahn committed
468

469
if (MARBLE_NO_WEBKITWIDGETS)
Gábor Péterffy's avatar
Gábor Péterffy committed
470
471
472
473
474
475
476
477
478
479
480
    set(marble_WebKit
        NullMarbleWebView.h
        NullTinyWebBrowser.h
        )
else()
    set(marble_WebKit
        MarbleWebView.h
        TinyWebBrowser.h
        )
endif()

481
install( FILES
482
    ${CMAKE_CURRENT_BINARY_DIR}/marble_export.h
483
    ${CMAKE_CURRENT_BINARY_DIR}/declarative/marble_declarative_export.h
484
    ${graphicsview_HDRS}
Gábor Péterffy's avatar
Gábor Péterffy committed
485
    ${marble_WebKit}
486
    AutoNavigation.h
487
    BookmarkManager.h
488
    DownloadRegion.h
489
    DownloadRegionDialog.h
490
    FileManager.h
491
    LatLonBoxWidget.h
Torsten Rahn's avatar
Torsten Rahn committed
492
493
    MarbleWidget.h
    MarbleMap.h
494
    MarbleModel.h
495
    MapViewWidget.h
496
    CelestialSortFilterProxyModel.h
497
    LegendWidget.h
498
    FileViewWidget.h
Mihail Ivchenko's avatar
Mihail Ivchenko committed
499
    TourWidget.h
500
501
502
503
    FlyToEditWidget.h
    TourControlEditWidget.h
    WaitEditWidget.h
    SoundCueEditWidget.h
Mihail Ivchenko's avatar
Mihail Ivchenko committed
504
    RemoveItemEditWidget.h
505
    TourItemDelegate.h
506
    MapViewItemDelegate.h
Illya Kovalevskyy's avatar
Illya Kovalevskyy committed
507
    TourPlayback.h
508
    CurrentLocationWidget.h
Torsten Rahn's avatar
Torsten Rahn committed
509
    MarbleNavigator.h
510
    AbstractFloatItem.h
511
    MapThemeManager.h
512
    MarbleAboutDialog.h
513
    MarbleInputHandler.h
Torsten Rahn's avatar
Torsten Rahn committed
514
    MarbleWidgetInputHandler.h
515
    MarbleWidgetPopupMenu.h
516
    TileId.h
517
518
    TileCoordsPyramid.h
    TileLevelRangeWidget.h
519
    QtMarbleConfigDialog.h
520
    MarbleMath.h
521
    MarbleColors.h
522
    MarbleGlobal.h
523
    MarbleLocale.h
524
    MarbleDebug.h
Torsten Rahn's avatar
Torsten Rahn committed
525
    MarbleDirs.h
Torsten Rahn's avatar
Torsten Rahn committed
526
    GeoPainter.h
527
    HttpDownloadManager.h
Torsten Rahn's avatar
Torsten Rahn committed
528
529
    TileCreatorDialog.h
    ViewportParams.h
530
    projections/AbstractProjection.h
531
    PositionTracking.h
Torsten Rahn's avatar
Torsten Rahn committed
532
533
534
    Quaternion.h
    SunLocator.h
    ClipPainter.h
535
    GeoGraphicsScene.h
536
    GeoDataTreeModel.h
537
538
    geodata/data/GeoDataAbstractView.h
    geodata/data/GeoDataAccuracy.h
539
    geodata/data/GeoDataBalloonStyle.h
540
541
542
543
544
545
546
    geodata/data/GeoDataColorStyle.h
    geodata/data/GeoDataContainer.h
    geodata/data/GeoDataCoordinates.h
    geodata/data/GeoDataDocument.h
    geodata/data/GeoDataFeature.h
    geodata/data/GeoDataFolder.h
    geodata/data/GeoDataGeometry.h
547
    geodata/data/GeoDataGroundOverlay.h
548
549
    geodata/data/GeoDataHotSpot.h
    geodata/data/GeoDataIconStyle.h
550
    geodata/data/GeoDataItemIcon.h
551
552
553
    geodata/data/GeoDataLabelStyle.h
    geodata/data/GeoDataLatLonAltBox.h
    geodata/data/GeoDataLatLonBox.h
554
    geodata/data/GeoDataLatLonQuad.h
555
556
557
    geodata/data/GeoDataLinearRing.h
    geodata/data/GeoDataLineString.h
    geodata/data/GeoDataLineStyle.h
558
    geodata/data/GeoDataListStyle.h
559
560
    geodata/data/GeoDataLod.h
    geodata/data/GeoDataLookAt.h
561
    geodata/data/GeoDataOverlay.h
562
563
564
565
566
567
568
    geodata/data/GeoDataMultiGeometry.h
    geodata/data/GeoDataObject.h
    geodata/data/GeoDataPlacemark.h
    geodata/data/GeoDataPoint.h
    geodata/data/GeoDataPolygon.h
    geodata/data/GeoDataPolyStyle.h
    geodata/data/GeoDataRegion.h
Dennis Nienhüser's avatar
Dennis Nienhüser committed
569
    geodata/data/GeoDataRelation.h
Dennis Nienhüser's avatar
Dennis Nienhüser committed
570
    geodata/data/GeoDataSnippet.h
571
572
573
    geodata/data/GeoDataStyle.h
    geodata/data/GeoDataStyleMap.h
    geodata/data/GeoDataStyleSelector.h
Dennis Nienhüser's avatar
Dennis Nienhüser committed
574
    geodata/data/GeoDataTrack.h
575
576
577
    geodata/data/GeoDataTimeSpan.h
    geodata/data/GeoDataTimeStamp.h
    geodata/data/GeoDataTimePrimitive.h
578
    geodata/data/Serializable.h
579
    geodata/geodata_export.h
580
    geodata/parser/GeoDocument.h
581
    geodata/parser/GeoDataTypes.h
582
    geodata/writer/GeoWriter.h
583
584
    routing/RoutingWidget.h
    routing/RoutingManager.h
Torsten Rahn's avatar
Torsten Rahn committed
585
    TileCreator.h
586
    PluginManager.h
587
    PluginInterface.h
588
    DialogConfigurationInterface.h
589
    PositionProviderPlugin.h
590
    PositionProviderPluginInterface.h
591
592
    RenderPlugin.h
    RenderPluginInterface.h
593
594
595
596
    ParsingRunnerManager.h
    ReverseGeocodingRunnerManager.h
    RoutingRunnerManager.h
    SearchRunnerManager.h
597
598
599
600
    ParsingRunner.h
    SearchRunner.h
    ReverseGeocodingRunner.h
    RoutingRunner.h
601
602
603
604
    SearchRunnerPlugin.h
    ReverseGeocodingRunnerPlugin.h
    RoutingRunnerPlugin.h
    ParseRunnerPlugin.h
Christoph Feck's avatar
Christoph Feck committed
605
    LayerInterface.h
606
    RenderState.h
607
    PluginAboutDialog.h
Henry de Valence's avatar
Henry de Valence committed
608
    Planet.h
609
    PlanetFactory.h
610
    EditPlacemarkDialog.h
611
    AddLinkDialog.h
612
    FormattedTextWidget.h
Torsten Rahn's avatar
   
Torsten Rahn committed
613

614
615
    AbstractDataPlugin.h
    AbstractDataPluginModel.h
Bastian Holst's avatar
Bastian Holst committed
616
    AbstractDataPluginItem.h
617
    AbstractWorkerThread.h
Torsten Rahn's avatar
Torsten Rahn committed
618

619
    LatLonEdit.h
620
    PlacemarkEditHeader.h
Utku Aydın's avatar
Utku Aydın committed
621
    MapWizard.h
622
    MapThemeDownloadDialog.h
623
    ElevationModel.h
Dennis Nienhüser's avatar
Dennis Nienhüser committed
624

625
    routing/AlternativeRoutesModel.h
Dennis Nienhüser's avatar
Dennis Nienhüser committed
626
627
628
629
630
631
632
633
    routing/Route.h
    routing/Maneuver.h
    routing/RouteRequest.h
    routing/RouteSegment.h
    routing/RoutingManager.h
    routing/RoutingModel.h
    routing/RoutingProfile.h

Sergey Popov's avatar
Sergey Popov committed
634
635
    OsmcSymbol.h

636
637
638

    declarative/MarbleDeclarativePlugin.h

639
    DESTINATION ${INCLUDE_INSTALL_DIR}/marble
Christian Ehrlicher's avatar
Christian Ehrlicher committed
640
)
641

642
643
644
645
646
647

########### CMake Config files ###############

include(CMakePackageConfigHelpers)

set(MARBLE_CMAKECONFIGNAME Marble)
648
set(MARBLE_INSTALL_CMAKECONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${MARBLE_CMAKECONFIGNAME})
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666

configure_package_config_file(MarbleConfig.cmake.in
    ${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}Config.cmake
    INSTALL_DESTINATION ${MARBLE_INSTALL_CMAKECONFIGDIR}
)

write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}ConfigVersion.cmake
    VERSION ${MARBLE_LIB_VERSION}
    COMPATIBILITY SameMajorVersion
)

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}Config.cmake
    ${CMAKE_CURRENT_BINARY_DIR}/${MARBLE_CMAKECONFIGNAME}ConfigVersion.cmake

    DESTINATION ${MARBLE_INSTALL_CMAKECONFIGDIR}
)

667
668
669
670
671
install(
    EXPORT MarbleTargets
    FILE ${MARBLE_CMAKECONFIGNAME}Targets.cmake
    DESTINATION ${MARBLE_INSTALL_CMAKECONFIGDIR}
)
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686

########### Qt Pri file ###############

# Where the pri file is installed is defined by the following rules, with decreasing priority:
# * MARBLE_PRI_INSTALL_USE_QT_SYS_PATHS=TRUE:
#   pri file will be installed with the dirs of the Qt installation used
# * MARBLE_PRI_INSTALL_DIR=some-relative-or-absolute-path
#   if set will be used as given
# * installation prefix = Qt installation prefix:
#   pri file will be installed with the dirs of the Qt installation used
# * otherwise:
#   pri file will be installed in mkspecs/modules in the installation prefix

get_target_property(PRI_LIB_NAME marblewidget OUTPUT_NAME)

687
set(PRI_ABS_INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_DIR}")
688
689
690
691
if(NOT IS_ABSOLUTE "${PRI_ABS_INCLUDE_INSTALL_DIR}")
    set(PRI_ABS_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${PRI_ABS_INCLUDE_INSTALL_DIR}")
endif()

692
set(PRI_ABS_LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
693
694
695
696
697
698
if(NOT IS_ABSOLUTE "${PRI_ABS_LIB_INSTALL_DIR}")
    set(PRI_ABS_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${PRI_ABS_LIB_INSTALL_DIR}")
endif()

set(PRI_DEPS "xml gui widgets network")
if (NOT MARBLE_NO_WEBKITWIDGETS)
699
    set(PRI_DEPS "${PRI_DEPS} webenginewidgets")
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
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
endif()

file(GENERATE
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qt_Marble.pri
    CONTENT
"QT.Marble.VERSION = ${MARBLE_LIB_VERSION}
QT.Marble.MAJOR_VERSION = ${MARBLE_LIB_VERSION_MAJOR}
QT.Marble.MINOR_VERSION = ${MARBLE_LIB_VERSION_MINOR}
QT.Marble.PATCH_VERSION = ${MARBLE_LIB_VERSION_PATCH}
QT.Marble.name = ${PRI_LIB_NAME}
QT.Marble.defines =
QT.Marble.includes = ${PRI_ABS_INCLUDE_INSTALL_DIR}
QT.Marble.private_includes =
QT.Marble.libs = ${PRI_ABS_LIB_INSTALL_DIR}
QT.Marble.depends = ${PRI_DEPS}
"
)

# detect which folder the pri file should be installed into
get_target_property(QMAKE_EXECUTABLE Qt5::qmake LOCATION)

function(query_qmake result_variable qt_variable)
    execute_process(
        COMMAND ${QMAKE_EXECUTABLE} -query "${qt_variable}"
        RESULT_VARIABLE return_code
        OUTPUT_VARIABLE output
    )
    if(return_code EQUAL 0)
        string(STRIP "${output}" output)
        file(TO_CMAKE_PATH "${output}" output_path)
        set(${result_variable} "${output_path}" PARENT_SCOPE)
    else()
        message(WARNING "Failed call: ${QMAKE_EXECUTABLE} -query \"${qt_variable}\"")
        message(FATAL_ERROR "QMake call failed: ${return_code}")
    endif()
endfunction()

# if going to be installed into same prefix as Qt, then also use same folder
set(IS_SHARED_INSTALL_PREFIX FALSE)
if(NOT DEFINED MARBLE_PRI_INSTALL_USE_QT_SYS_PATHS)
    query_qmake(qt_install_prefix_dir QT_INSTALL_PREFIX)
    if(qt_install_prefix_dir STREQUAL "${CMAKE_INSTALL_PREFIX}")
        set(IS_SHARED_INSTALL_PREFIX TRUE)
    endif()
endif()

if(MARBLE_PRI_INSTALL_USE_QT_SYS_PATHS OR IS_SHARED_INSTALL_PREFIX)
    query_qmake(qt_host_data_dir QT_HOST_DATA)
    set(PRI_INSTALL_DIR ${qt_host_data_dir}/mkspecs/modules)
else()
    set(PRI_INSTALL_DIR mkspecs/modules)
endif()
set(MARBLE_PRI_INSTALL_DIR "${PRI_INSTALL_DIR}" CACHE PATH "The directory where the Marble pri file will be installed to.")

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/qt_Marble.pri
    DESTINATION  ${MARBLE_PRI_INSTALL_DIR}
)