CMakeLists.txt 3.84 KB
Newer Older
1 2 3 4 5
if (TARGET KF5::Notifications)
    SET(HAVE_NOTIFICATIONS TRUE)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-itinerary.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-itinerary.h)

6
set(itinerary_srcs
7 8
    applicationcontroller.cpp
    contenttypeprober.cpp
9
    countryinformation.cpp
10
    pkpassmanager.cpp
11
    pkpassimageprovider.cpp
12
    reservationmanager.cpp
13
    timelinemodel.cpp
14 15
    tripgroup.cpp
    tripgroupmanager.cpp
16
    tripgroupproxymodel.cpp
17
)
18 19 20 21 22 23
ecm_qt_declare_logging_category(itinerary_srcs
    HEADER logging.h
    IDENTIFIER Log
    CATEGORY_NAME org.kde.itinerary
)
add_library(itinerary STATIC ${itinerary_srcs})
24
target_link_libraries(itinerary PUBLIC
25
    itinerary-weather
26
    KPim::Itinerary
Volker Krause's avatar
Volker Krause committed
27
    KPim::PkPass
28
    KF5::I18n
29
    Qt5::Network
30
    Qt5::Quick
31 32
)

33 34 35 36 37 38
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
39
set(itinerary_app_srcs
40
    main.cpp
41
    countrymodel.cpp
42
    localizer.cpp
43
    settings.cpp
44
    tickettokenmodel.cpp
45
    util.cpp
46
    weatherforecastmodel.cpp
47
    ${qml_srcs}
Volker Krause's avatar
Volker Krause committed
48
    brightnessmanager.cpp
49
    livedatamanager.cpp
50
    journeyquerymodel.cpp
51
    publictransport.cpp
52
)
53
if (ANDROID)
54 55 56 57
    list(APPEND itinerary_app_srcs
        androidbrightnessbackend.cpp
        androidcontentfileengine.cpp
    )
58
else()
Volker Krause's avatar
Volker Krause committed
59 60 61 62 63
    list(APPEND itinerary_app_srcs solidbrightnessbackend.cpp)
    qt5_add_dbus_interface(itinerary_app_srcs org.kde.Solid.PowerManagement.Actions.BrightnessControl.xml brightnesscontroldbusinterface)
endif()

add_executable(itinerary-app ${itinerary_app_srcs})
64 65 66
target_include_directories(itinerary-app PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(itinerary-app PRIVATE
    itinerary
Volker Krause's avatar
Volker Krause committed
67
    KF5::Contacts
68
    KF5::CoreAddons
69
    KPublicTransport
70
)
71 72 73
if (TARGET KF5::Notifications)
    target_link_libraries(itinerary-app PRIVATE KF5::Notifications)
endif()
74
if (ANDROID)
75
    target_include_directories(itinerary-app PRIVATE ${Qt5Core_PRIVATE_INCLUDE_DIRS})
76 77
    # explicitly add runtime dependencies and transitive link dependencies,
    # so androiddeployqt picks them up
78
    target_link_libraries(itinerary PUBLIC Qt5::AndroidExtras)
79 80 81
    target_link_libraries(itinerary-app PRIVATE
        KF5::Archive
        KF5::Kirigami2
Volker Krause's avatar
Volker Krause committed
82
        Qt5::Svg
83
        KF5::Prison
Volker Krause's avatar
Volker Krause committed
84
        OpenSSL::SSL
85
    )
Volker Krause's avatar
Volker Krause committed
86 87

    kirigami_package_breeze_icons(ICONS
88
        checkmark
89
        clock
90
        dialog-cancel
91
        document-edit
Volker Krause's avatar
Volker Krause committed
92
        document-open
93
        document-save
94
        documentinfo
Volker Krause's avatar
Volker Krause committed
95
        edit-delete
96
        edit-download
97
        edit-paste
98
        go-down-symbolic
99
        go-home
Volker Krause's avatar
Volker Krause committed
100
        go-next-symbolic
101
        go-up-symbolic
Volker Krause's avatar
Volker Krause committed
102
        help-about
Volker Krause's avatar
Volker Krause committed
103
        map-symbolic
104
        meeting-attending
Volker Krause's avatar
Volker Krause committed
105
        settings-configure
Volker Krause's avatar
Volker Krause committed
106
        view-calendar-day
Volker Krause's avatar
Volker Krause committed
107
        view-refresh
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130

        weather-clear
        weather-clear-night
        weather-few-clouds
        weather-few-clouds-night
        weather-clouds
        weather-clouds-night
        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
        weather-fog
        weather-showers
        weather-showers-scattered
        weather-hail
        weather-snow
        weather-snow-scattered
        weather-storm
Volker Krause's avatar
Volker Krause committed
131
    )
132
else ()
133
    target_link_libraries(itinerary PRIVATE Qt5::Positioning Qt5::DBus)
134 135 136 137
    target_link_libraries(itinerary-app PRIVATE
        KF5::DBusAddons
        Qt5::Widgets
    )
138 139
    set_target_properties(itinerary-app PROPERTIES OUTPUT_NAME "itinerary")
endif()
140 141

install(TARGETS itinerary-app ${INSTALL_TARGETS_DEFAULT_ARGS})
Volker Krause's avatar
Volker Krause committed
142 143 144
if (NOT ANDROID)
    install(PROGRAMS org.kde.itinerary.desktop DESTINATION ${KDE_INSTALL_APPDIR})
endif()
145
install(FILES org.kde.itinerary.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})