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

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
add_subdirectory(vdv/certs)
configure_file(config-kitinerary.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kitinerary.h)

set(kitinerary_lib_srcs
    datatypes/action.cpp
    datatypes/brand.cpp
    datatypes/bustrip.cpp
    datatypes/creativework.cpp
    datatypes/event.cpp
    datatypes/flight.cpp
    datatypes/organization.cpp
    datatypes/person.cpp
    datatypes/place.cpp
    datatypes/reservation.cpp
    datatypes/taxi.cpp
    datatypes/ticket.cpp
    datatypes/traintrip.cpp
    datatypes/rentalcar.cpp
    datatypes/visit.cpp

24
    engine/abstractextractor.cpp
25
    engine/extractordocumentnode.cpp
26
    engine/extractordocumentnodefactory.cpp
27
    engine/extractordocumentprocessor.cpp
Volker Krause's avatar
Volker Krause committed
28
    engine/extractorengine.cpp
29
    engine/extractorfilter.cpp
30
    engine/extractorrepository.cpp
31
    engine/extractorresult.cpp
32
33
34
    engine/extractorscriptengine.cpp
    engine/scriptextractor.cpp

Volker Krause's avatar
Volker Krause committed
35
36
    era/ssbticket.cpp

Volker Krause's avatar
Volker Krause committed
37
38
    extractors/iatabcbpextractor.cpp

39
40
41
42
43
44
45
46
47
48
49
50
51
52
    jsapi/barcode.cpp
    jsapi/bitarray.cpp
    jsapi/context.cpp
    jsapi/jsonld.cpp

    knowledgedb/alphaid.cpp
    knowledgedb/airportdb.cpp
    knowledgedb/countrydb.cpp
    knowledgedb/iatacode.cpp
    knowledgedb/knowledgedb.cpp
    knowledgedb/stationidentifier.cpp
    knowledgedb/timezonedb.cpp
    knowledgedb/trainstationdb.cpp

53
    pdf/pdfbarcodeutil.cpp
54
55
56
57
58
59
60
    pdf/pdfdocument.cpp
    pdf/pdfextractoroutputdevice.cpp
    pdf/pdfimage.cpp
    pdf/pdfvectorpicture.cpp
    pdf/popplerglobalparams.cpp
    pdf/popplerutils.cpp

61
    processors/binarydocumentprocessor.cpp
62
    processors/externalprocessor.cpp
63
64
65
66
67
68
69
70
71
72
73
    processors/htmldocumentprocessor.cpp
    processors/icaldocumentprocessor.cpp
    processors/imagedocumentprocessor.cpp
    processors/jsonlddocumentprocessor.cpp
    processors/mimedocumentprocessor.cpp
    processors/pdfdocumentprocessor.cpp
    processors/pkpassdocumentprocessor.cpp
    processors/textdocumentprocessor.cpp
    processors/uic9183documentprocessor.cpp
    processors/vdvdocumentprocessor.cpp

74
75
    scripts/extractors.qrc

76
77
78
79
    tlv/berelement.cpp

    uic9183/rct2ticket.cpp
    uic9183/uic9183block.cpp
80
    uic9183/uic9183head.cpp
Volker Krause's avatar
Volker Krause committed
81
    uic9183/uic9183header.cpp
82
83
    uic9183/uic9183parser.cpp
    uic9183/uic9183ticketlayout.cpp
Volker Krause's avatar
Volker Krause committed
84
    uic9183/uic9183utils.cpp
85
    uic9183/vendor0080block.cpp
86
    uic9183/vendor0080vublockdata.cpp
87
88
89
90

    vdv/iso9796_2decoder.cpp
    vdv/vdvcertificate.cpp
    vdv/vdvticket.cpp
91
    vdv/vdvticketcontent.cpp
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
    vdv/vdvticketparser.cpp
    vdv/certs/vdv-certs.qrc

    barcodedecoder.cpp
    calendarhandler.cpp
    documentutil.cpp
    extractorcapabilities.cpp
    extractorpostprocessor.cpp
    extractorutil.cpp
    extractorvalidator.cpp
    file.cpp
    flightpostprocessor.cpp
    htmldocument.cpp
    iatabcbpparser.cpp
    jsonlddocument.cpp
    jsonldimportfilter.cpp
    locationutil.cpp
    mergeutil.cpp
    qimagepurebinarizer.cpp
    sortutil.cpp
    stringutil.cpp
)
kde_source_files_enable_exceptions(barcodedecoder.cpp qimagepurebinarizer.cpp)
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER logging.h IDENTIFIER KItinerary::Log CATEGORY_NAME org.kde.kitinerary)
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER compare-logging.h IDENTIFIER KItinerary::CompareLog CATEGORY_NAME org.kde.kitinerary.comparator)
ecm_qt_declare_logging_category(kitinerary_lib_srcs HEADER validator-logging.h IDENTIFIER KItinerary::ValidatorLog CATEGORY_NAME org.kde.kitinerary.extractorValidator)

add_library(KPimItinerary ${kitinerary_lib_srcs})
add_library(KPim::Itinerary ALIAS KPimItinerary)
generate_export_header(KPimItinerary BASE_NAME KItinerary)
set_target_properties(KPimItinerary PROPERTIES
123
    VERSION ${KITINERARY_VERSION}
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
    SOVERSION ${KITINERARY_SOVERSION}
    EXPORT_NAME Itinerary
)
target_include_directories(KPimItinerary INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_PIM}>")
target_include_directories(KPimItinerary PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
target_include_directories(KPimItinerary PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(KPimItinerary
    PUBLIC
        Qt5::Core
        KF5::Mime
    PRIVATE
        Qt5::Qml
        KF5::Archive
        KF5::I18n
        KF5::Contacts
        KPim::PkPass
        ${ZLIB_LIBRARIES}
)
if (HAVE_POPPLER)
    target_link_libraries(KPimItinerary PRIVATE Poppler::Core)
endif()

if (TARGET ZXing::ZXing)
    target_link_libraries(KPimItinerary PRIVATE ZXing::ZXing)
elseif (TARGET ZXing::Core)
    target_link_libraries(KPimItinerary PRIVATE ZXing::Core)
endif()

if (HAVE_KCAL)
    target_link_libraries(KPimItinerary PUBLIC KF5::CalendarCore)
endif()
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()
if (HAVE_PHONENUMBER)
    target_link_libraries(KPimItinerary PRIVATE PhoneNumber::PhoneNumber)
endif()
if (HAVE_OPENSSL_RSA)
    target_link_libraries(KPimItinerary PRIVATE OpenSSL::Crypto)
endif()

ecm_generate_headers(KItinerary_FORWARDING_HEADERS
    HEADER_NAMES
        BarcodeDecoder
        CalendarHandler
        DocumentUtil
        ExtractorCapabilities
        ExtractorPostprocessor
        ExtractorValidator
        File
        HtmlDocument
        IataBcbpParser
        JsonLdDocument
        LocationUtil
        MergeUtil
        SortUtil
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_HEADERS
)
ecm_generate_headers(KItinerary_KnowledgeDb_FORWARDING_HEADERS
    HEADER_NAMES
        AlphaId
        CountryDb
        KnowledgeDb
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_KnowledgeDb_HEADERS
    RELATIVE knowledgedb
)
ecm_generate_headers(KItinerary_Datatypes_FORWARDING_HEADERS
    HEADER_NAMES
        Action
        Brand
        BusTrip
        CreativeWork
        Datatypes
        Event
        Flight
        Organization
        Reservation
        RentalCar
        Person
        Place
        Taxi
        Ticket
        TrainTrip
        Visit
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Datatypes_HEADERS
    RELATIVE datatypes
)
216
217
ecm_generate_headers(KItinerary_Engine_FORWARDING_HEADERS
    HEADER_NAMES
218
        AbstractExtractor
219
        ExtractorDocumentNode
220
221
        ExtractorDocumentNodeFactory
        ExtractorDocumentProcessor
Volker Krause's avatar
Volker Krause committed
222
        ExtractorEngine
223
        ExtractorFilter
224
        ExtractorRepository
225
        ExtractorResult
226
        ScriptExtractor
227
228
229
230
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Engine_HEADERS
    RELATIVE engine
)
231
232
233
234
235
236
237
238
239
240
241
242
243
244
ecm_generate_headers(KItinerary_Pdf_FORWARDING_HEADERS
    HEADER_NAMES
        PdfDocument
        PdfImage
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Pdf_HEADERS
    RELATIVE pdf
)
ecm_generate_headers(KItinerary_Uic9183_FORWARDING_HEADERS
    HEADER_NAMES
        Rct2Ticket
        Uic9183Block
        Uic9183Parser
        Uic9183TicketLayout
245
        Uic9183Utils
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
        Vendor0080Block
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Uic9183_HEADERS
    RELATIVE uic9183
)

ecm_generate_headers(KItinerary_Vdv_FORWARDING_HEADERS
    HEADER_NAMES
        VdvTicket
        VdvTicketParser
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Vdv_HEADERS
    RELATIVE vdv
)

install(TARGETS KPimItinerary EXPORT KPimItineraryTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES
    ${KItinerary_FORWARDING_HEADERS}
    ${KItinerary_KnowledgeDb_FORWARDING_HEADERS}
    ${KItinerary_Datatypes_FORWARDING_HEADERS}
266
    ${KItinerary_Engine_FORWARDING_HEADERS}
267
268
269
270
271
272
273
274
275
276
    ${KItinerary_Pdf_FORWARDING_HEADERS}
    ${KItinerary_Uic9183_FORWARDING_HEADERS}
    ${KItinerary_Vdv_FORWARDING_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_PIM}/KItinerary
)
install(FILES
    ${KItinerary_HEADERS}
    ${KItinerary_AirportDb_HEADERS}
    ${KItinerary_Datatypes_HEADERS}
    ${KItinerary_KnowledgeDb_HEADERS}
277
    ${KItinerary_Engine_HEADERS}
278
279
280
281
282
283
284
285
286
287
    ${KItinerary_Pdf_HEADERS}
    ${KItinerary_Uic9183_HEADERS}
    ${KItinerary_Vdv_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/kitinerary_export.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_PIM}/kitinerary
)
if (NOT ANDROID)
    install(FILES application-vnd-kde-itinerary.xml DESTINATION ${KDE_INSTALL_MIMEDIR})
    update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
endif()