CMakeLists.txt 6.93 KB
Newer Older
Volker Krause's avatar
Volker Krause committed
1
add_subdirectory(cli)
2 3 4
if (TARGET Qt5::Network)
    add_subdirectory(knowledgedb-generator)
endif()
5
add_subdirectory(vdv/certs)
6
configure_file(config-kitinerary.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kitinerary.h)
7 8

set(kitinerary_lib_srcs
9
    datatypes/action.cpp
Benjamin Port's avatar
Benjamin Port committed
10
    datatypes/brand.cpp
Volker Krause's avatar
Volker Krause committed
11
    datatypes/bustrip.cpp
12
    datatypes/creativework.cpp
13
    datatypes/event.cpp
Volker Krause's avatar
Volker Krause committed
14
    datatypes/flight.cpp
Luca Beltrame's avatar
Luca Beltrame committed
15
    datatypes/organization.cpp
16
    datatypes/person.cpp
Volker Krause's avatar
Volker Krause committed
17 18
    datatypes/place.cpp
    datatypes/reservation.cpp
19
    datatypes/taxi.cpp
Volker Krause's avatar
Volker Krause committed
20 21
    datatypes/ticket.cpp
    datatypes/traintrip.cpp
Laurent Montel's avatar
Laurent Montel committed
22
    datatypes/rentalcar.cpp
23
    datatypes/visit.cpp
Volker Krause's avatar
Volker Krause committed
24

25
    generic/genericextractor.cpp
26
    generic/genericicalextractor.cpp
27 28 29
    generic/genericpdfextractor.cpp
    generic/genericpkpassextractor.cpp
    generic/genericuic918extractor.cpp
30
    generic/genericvdvextractor.cpp
31 32
    generic/structureddataextractor.cpp

33
    jsapi/barcode.cpp
34
    jsapi/bitarray.cpp
35 36 37
    jsapi/context.cpp
    jsapi/jsonld.cpp

38
    knowledgedb/alphaid.cpp
39
    knowledgedb/airportdb.cpp
40
    knowledgedb/countrydb.cpp
41
    knowledgedb/iatacode.cpp
42 43
    knowledgedb/knowledgedb.cpp
    knowledgedb/timezonedb.cpp
Volker Krause's avatar
Volker Krause committed
44
    knowledgedb/trainstationdb.cpp
45

46
    pdf/pdfdocument.cpp
47
    pdf/pdfextractoroutputdevice.cpp
Volker Krause's avatar
Volker Krause committed
48
    pdf/pdfimage.cpp
49
    pdf/pdfvectorpicture.cpp
50
    pdf/popplerglobalparams.cpp
51 52
    pdf/popplerutils.cpp

53 54
    tlv/berelement.cpp

55
    uic9183/rct2ticket.cpp
56
    uic9183/uic9183block.cpp
57 58
    uic9183/uic9183parser.cpp
    uic9183/uic9183ticketlayout.cpp
59
    uic9183/vendor0080block.cpp
60

61
    vdv/iso9796_2decoder.cpp
62
    vdv/vdvcertificate.cpp
Volker Krause's avatar
Volker Krause committed
63
    vdv/vdvticket.cpp
64
    vdv/vdvticketparser.cpp
65
    vdv/certs/vdv-certs.qrc
66

67
    barcodedecoder.cpp
68
    calendarhandler.cpp
69
    documentutil.cpp
70
    extractor.cpp
71
    extractorcapabilities.cpp
72 73
    extractorengine.cpp
    extractorfilter.cpp
74
    extractorinput.cpp
75 76
    extractorpostprocessor.cpp
    extractorrepository.cpp
77
    extractorutil.cpp
78
    extractorvalidator.cpp
79
    file.cpp
80
    flightpostprocessor.cpp
81
    htmldocument.cpp
82
    iatabcbpparser.cpp
83
    jsonlddocument.cpp
84
    jsonldimportfilter.cpp
Volker Krause's avatar
Volker Krause committed
85
    locationutil.cpp
86
    mergeutil.cpp
87
    qimagepurebinarizer.cpp
88
    sortutil.cpp
89
    stringutil.cpp
90 91
)
qt5_add_resources(kitinerary_lib_srcs extractors/extractors.qrc)
Volker Krause's avatar
Volker Krause committed
92
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER logging.h IDENTIFIER KItinerary::Log CATEGORY_NAME org.kde.kitinerary)
93
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER compare-logging.h IDENTIFIER KItinerary::CompareLog CATEGORY_NAME org.kde.kitinerary.comparator)
94
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER validator-logging.h IDENTIFIER KItinerary::ValidatorLog CATEGORY_NAME org.kde.kitinerary.extractorValidator)
95

96
add_library(KPimItinerary ${kitinerary_lib_srcs})
97 98 99
add_library(KPim::Itinerary ALIAS KPimItinerary)
generate_export_header(KPimItinerary BASE_NAME KItinerary)
set_target_properties(KPimItinerary PROPERTIES
100 101
    VERSION ${KITINERARY_VERSION_STRING}
    SOVERSION ${KITINERARY_SOVERSION}
102
    EXPORT_NAME Itinerary
103
)
104 105
target_include_directories(KPimItinerary INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_PIM}>")
target_include_directories(KPimItinerary PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
106
target_include_directories(KPimItinerary PRIVATE ${CMAKE_BINARY_DIR})
107
target_link_libraries(KPimItinerary
108 109 110 111 112
    PUBLIC
        Qt5::Core
        KF5::Mime
    PRIVATE
        Qt5::Qml
113
        KF5::Archive
114
        KF5::I18n
115
        KF5::Contacts
Volker Krause's avatar
Volker Krause committed
116
        KPim::PkPass
Volker Krause's avatar
Volker Krause committed
117
        ${ZLIB_LIBRARIES}
118 119
)
if (HAVE_POPPLER)
120
    target_link_libraries(KPimItinerary PRIVATE Poppler::Core)
121
endif()
122

123
if (HAVE_ZXING)
124
    target_link_libraries(KPimItinerary PRIVATE ZXing::Core)
125
endif()
126

127 128 129
if (HAVE_KCAL)
    target_link_libraries(KPimItinerary PUBLIC KF5::CalendarCore)
endif()
130 131 132 133 134
if (HAVE_LIBXML2)
    target_compile_definitions(KPimItinerary PRIVATE ${LIBXML2_DEFINITIONS})
    target_include_directories(KPimItinerary PRIVATE ${LIBXML2_INCLUDE_DIR})
    target_link_libraries(KPimItinerary PRIVATE ${LIBXML2_LIBRARIES})
endif()
135 136 137
if (HAVE_PHONENUMBER)
    target_link_libraries(KPimItinerary PRIVATE PhoneNumber::PhoneNumber)
endif()
138 139 140
if (HAVE_OPENSSL_RSA)
    target_link_libraries(KPimItinerary PRIVATE OpenSSL::Crypto)
endif()
141

142
ecm_generate_headers(KItinerary_FORWARDING_HEADERS
143
    HEADER_NAMES
144
        BarcodeDecoder
Volker Krause's avatar
Volker Krause committed
145
        CalendarHandler
146
        DocumentUtil
147
        Extractor
148
        ExtractorCapabilities
149
        ExtractorEngine
Volker Krause's avatar
Volker Krause committed
150
        ExtractorFilter
151
        ExtractorInput
152
        ExtractorPostprocessor
Volker Krause's avatar
Volker Krause committed
153
        ExtractorRepository
154
        ExtractorValidator
155
        File
156
        HtmlDocument
Volker Krause's avatar
Volker Krause committed
157
        IataBcbpParser
158
        JsonLdDocument
Volker Krause's avatar
Volker Krause committed
159
        LocationUtil
160
        MergeUtil
161
        SortUtil
Volker Krause's avatar
Volker Krause committed
162
    PREFIX KItinerary
163 164
    REQUIRED_HEADERS KItinerary_HEADERS
)
165
ecm_generate_headers(KItinerary_KnowledgeDb_FORWARDING_HEADERS
Volker Krause's avatar
Volker Krause committed
166
    HEADER_NAMES
167
        AlphaId
168
        CountryDb
169
        KnowledgeDb
Volker Krause's avatar
Volker Krause committed
170
    PREFIX KItinerary
171 172
    REQUIRED_HEADERS KItinerary_KnowledgeDb_HEADERS
    RELATIVE knowledgedb
Volker Krause's avatar
Volker Krause committed
173
)
174
ecm_generate_headers(KItinerary_Datatypes_FORWARDING_HEADERS
Volker Krause's avatar
Volker Krause committed
175
    HEADER_NAMES
176
        Action
Benjamin Port's avatar
Benjamin Port committed
177
        Brand
Volker Krause's avatar
Volker Krause committed
178
        BusTrip
179
        CreativeWork
Volker Krause's avatar
Volker Krause committed
180
        Datatypes
181
        Event
Volker Krause's avatar
Volker Krause committed
182
        Flight
Luca Beltrame's avatar
Luca Beltrame committed
183
        Organization
Volker Krause's avatar
Volker Krause committed
184
        Reservation
Laurent Montel's avatar
Laurent Montel committed
185
        RentalCar
186
        Person
Volker Krause's avatar
Volker Krause committed
187
        Place
188
        Taxi
Volker Krause's avatar
Volker Krause committed
189 190
        Ticket
        TrainTrip
191
        Visit
Volker Krause's avatar
Volker Krause committed
192 193 194 195
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Datatypes_HEADERS
    RELATIVE datatypes
)
Volker Krause's avatar
Volker Krause committed
196 197
ecm_generate_headers(KItinerary_Pdf_FORWARDING_HEADERS
    HEADER_NAMES
198
        PdfDocument
Volker Krause's avatar
Volker Krause committed
199 200 201 202 203
        PdfImage
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Pdf_HEADERS
    RELATIVE pdf
)
204 205 206
ecm_generate_headers(KItinerary_Uic9183_FORWARDING_HEADERS
    HEADER_NAMES
        Rct2Ticket
207
        Uic9183Block
208 209
        Uic9183Parser
        Uic9183TicketLayout
210
        Vendor0080Block
211 212 213 214
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Uic9183_HEADERS
    RELATIVE uic9183
)
215

216 217
ecm_generate_headers(KItinerary_Vdv_FORWARDING_HEADERS
    HEADER_NAMES
Volker Krause's avatar
Volker Krause committed
218
        VdvTicket
219 220 221 222 223 224
        VdvTicketParser
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Vdv_HEADERS
    RELATIVE vdv
)

225
install(TARGETS KPimItinerary EXPORT KPimItineraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
226 227
install(FILES
    ${KItinerary_FORWARDING_HEADERS}
228
    ${KItinerary_KnowledgeDb_FORWARDING_HEADERS}
229
    ${KItinerary_Datatypes_FORWARDING_HEADERS}
Volker Krause's avatar
Volker Krause committed
230
    ${KItinerary_Pdf_FORWARDING_HEADERS}
231
    ${KItinerary_Uic9183_FORWARDING_HEADERS}
232
    ${KItinerary_Vdv_FORWARDING_HEADERS}
233
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_PIM}/KItinerary
234
)
235 236
install(FILES
    ${KItinerary_HEADERS}
Volker Krause's avatar
Volker Krause committed
237
    ${KItinerary_AirportDb_HEADERS}
Volker Krause's avatar
Volker Krause committed
238
    ${KItinerary_Datatypes_HEADERS}
239
    ${KItinerary_KnowledgeDb_HEADERS}
Volker Krause's avatar
Volker Krause committed
240
    ${KItinerary_Pdf_HEADERS}
241
    ${KItinerary_Uic9183_HEADERS}
242
    ${KItinerary_Vdv_HEADERS}
243
    ${CMAKE_CURRENT_BINARY_DIR}/kitinerary_export.h
244
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_PIM}/kitinerary
245
)
246 247 248 249
if (NOT ANDROID)
    install(FILES application-vnd-kde-itinerary.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
    update_xdg_mimetypes(${XDG_MIME_INSTALL_DIR})
endif()