CMakeLists.txt 5.02 KB
Newer Older
1
2
3
# SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause

4
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itinerary_version_detailed.h.in ${CMAKE_CURRENT_BINARY_DIR}/itinerary_version_detailed.h)
5

Volker Krause's avatar
Volker Krause committed
6
set(itinerary_srcs
7
    applicationcontroller.cpp
Volker Krause's avatar
Volker Krause committed
8
    documentmanager.cpp
9
    favoritelocationmodel.cpp
10
    importexport.cpp
11
    json.cpp
Volker Krause's avatar
Volker Krause committed
12
    livedata.cpp
13
    livedatamanager.cpp
14
15
    localizer.cpp
    locationhelper.cpp
16
    locationinformation.cpp
17
    navigationcontroller.cpp
18
    notificationhelper.cpp
19
    pkpassmanager.cpp
20
    pkpassimageprovider.cpp
21
    publictransport.cpp
22
    reservationhelper.cpp
23
    reservationmanager.cpp
Volker Krause's avatar
Volker Krause committed
24
25
    statisticsmodel.cpp
    statisticstimerangemodel.cpp
26
    timelinedelegatecontroller.cpp
27
    timelineelement.cpp
28
    timelinemodel.cpp
Volker Krause's avatar
Volker Krause committed
29
    tripgroup.cpp
30
    tripgroupinfoprovider.cpp
Volker Krause's avatar
Volker Krause committed
31
    tripgroupmanager.cpp
32
    tripgroupproxymodel.cpp
33
34
    transfer.cpp
    transfermanager.cpp
35
    util.cpp
36
)
Volker Krause's avatar
Volker Krause committed
37
38
39
40
41
42
ecm_qt_declare_logging_category(itinerary_srcs
    HEADER logging.h
    IDENTIFIER Log
    CATEGORY_NAME org.kde.itinerary
)
add_library(itinerary STATIC ${itinerary_srcs})
43
target_link_libraries(itinerary PUBLIC
44
    itinerary-weather
45
    SolidExtras
46
    KPublicTransport
47
    KPim::Itinerary
Volker Krause's avatar
Volker Krause committed
48
    KPim::PkPass
49
    KF5::I18n
50
    KF5::Contacts
51
    KF5::CoreAddons
52
    KF5::Notifications
53
    Qt5::Network
54
    Qt5::Quick
55
56
)

57
58
59
60
61
62
if (Qt5QuickCompiler_FOUND)
    qtquick_compiler_add_resources(qml_srcs qml.qrc)
else ()
    set(qml_srcs qml.qrc)
endif()

Volker Krause's avatar
Volker Krause committed
63
set(itinerary_app_srcs
64
    main.cpp
65
    countrymodel.cpp
66
    developmentmodecontroller.cpp
67
    documentsmodel.cpp
68
    mapdownloadmanager.cpp
69
    notificationconfigcontroller.cpp
Volker Krause's avatar
Volker Krause committed
70
    notifyrc.qrc
Volker Krause's avatar
Volker Krause committed
71
    settings.cpp
72
    tickettokenmodel.cpp
73
    weatherforecastmodel.cpp
74
    ${qml_srcs}
75
)
Volker Krause's avatar
Volker Krause committed
76
77

add_executable(itinerary-app ${itinerary_app_srcs})
78
79
80
target_include_directories(itinerary-app PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(itinerary-app PRIVATE
    itinerary
Volker Krause's avatar
Volker Krause committed
81
    KOSMIndoorMap
82
    Qt5::QuickControls2
83
)
84
if (ANDROID)
85
    target_include_directories(itinerary-app PRIVATE ${Qt5Core_PRIVATE_INCLUDE_DIRS})
86
87
    # explicitly add runtime dependencies and transitive link dependencies,
    # so androiddeployqt picks them up
88
    target_link_libraries(itinerary PUBLIC Qt5::AndroidExtras KAndroidExtras)
89
    target_link_libraries(itinerary-app PRIVATE
90
        KF5::Mime
91
92
        KF5::Archive
        KF5::Kirigami2
Volker Krause's avatar
Volker Krause committed
93
        Qt5::Svg
94
        KF5::Prison
Volker Krause's avatar
Volker Krause committed
95
        OpenSSL::SSL
96
    )
Volker Krause's avatar
Volker Krause committed
97

98
99
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/android/version.gradle.in ${CMAKE_BINARY_DIR}/version.gradle)

Volker Krause's avatar
Volker Krause committed
100
    kirigami_package_breeze_icons(ICONS
Volker Krause's avatar
Volker Krause committed
101
        application-pdf
102
103
        channel-insecure-symbolic
        channel-secure-symbolic
104
        checkmark
105
        clock
Volker Krause's avatar
Volker Krause committed
106
        crosshairs
107
        dialog-cancel
108
        dialog-close
109
        document-edit
Volker Krause's avatar
Volker Krause committed
110
        document-open
111
        document-save
112
        documentinfo
113
        download
Volker Krause's avatar
Volker Krause committed
114
        edit-delete
115
        edit-download
116
        edit-paste
117
        edit-rename
118
        export-symbolic
Volker Krause's avatar
Volker Krause committed
119
        folder-documents-symbolic
120
        go-down-symbolic
121
        go-home-symbolic
Volker Krause's avatar
Volker Krause committed
122
        go-next-symbolic
123
        go-up-symbolic
124
        help-about-symbolic
Volker Krause's avatar
Volker Krause committed
125
        help-contents
Volker Krause's avatar
Volker Krause committed
126
        list-add
127
        map-globe
Volker Krause's avatar
Volker Krause committed
128
        map-symbolic
129
        meeting-attending
130
        notifications
131
        question
Volker Krause's avatar
Volker Krause committed
132
        settings-configure
Volker Krause's avatar
Volker Krause committed
133
        view-calendar-day
134
        view-list-symbolic
Volker Krause's avatar
Volker Krause committed
135
        view-refresh
Volker Krause's avatar
Volker Krause committed
136
        view-statistics
137
138
        zoom-in-symbolic
        zoom-out-symbolic
139
140

        weather-clear
141
        weather-clear-wind
142
        weather-clear-night
143
        weather-clear-wind-night
144
        weather-few-clouds
145
        weather-few-clouds-wind
146
        weather-few-clouds-night
147
        weather-few-clouds-wind-night
148
        weather-clouds
149
        weather-clouds-wind
150
        weather-clouds-night
151
        weather-clouds-wind-night
152
153
154
155
156
157
158
159
160
        weather-showers-day
        weather-showers-night
        weather-showers-scattered-day
        weather-showers-scattered-night
        weather-snow-scattered-day
        weather-snow-scattered-night
        weather-storm-day
        weather-storm-night
        weather-many-clouds
Volker Krause's avatar
Volker Krause committed
161
        weather-many-clouds-wind
162
163
164
165
166
167
168
        weather-fog
        weather-showers
        weather-showers-scattered
        weather-hail
        weather-snow
        weather-snow-scattered
        weather-storm
Volker Krause's avatar
Volker Krause committed
169
    )
170
else ()
Volker Krause's avatar
Volker Krause committed
171
    target_link_libraries(itinerary PRIVATE Qt5::Positioning Qt5::DBus Qt5::Widgets)
172
173
174
175
    target_link_libraries(itinerary-app PRIVATE
        KF5::DBusAddons
        Qt5::Widgets
    )
176
177
    set_target_properties(itinerary-app PROPERTIES OUTPUT_NAME "itinerary")
endif()
Volker Krause's avatar
Volker Krause committed
178
179
180
if (TARGET KF5::Crash)
    target_link_libraries(itinerary-app PRIVATE KF5::Crash)
endif()
181
182

install(TARGETS itinerary-app ${INSTALL_TARGETS_DEFAULT_ARGS})
183
ecm_install_icons(ICONS 48-apps-itinerary.svg DESTINATION ${KDE_INSTALL_ICONDIR})
Volker Krause's avatar
Volker Krause committed
184
if (NOT ANDROID)
185
186
    install(PROGRAMS org.kde.itinerary.desktop DESTINATION ${KDE_INSTALL_APPDIR})
    install(FILES org.kde.itinerary.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Volker Krause's avatar
Volker Krause committed
187
188
    install(FILES itinerary.notifyrc DESTINATION ${KNOTIFYRC_INSTALL_DIR})
endif()