CMakeLists.txt 7 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
124
125
if (TARGET ZXing::ZXing)
    target_link_libraries(KPimItinerary PRIVATE ZXing::ZXing)
elseif (TARGET ZXing::Core)
126
    target_link_libraries(KPimItinerary PRIVATE ZXing::Core)
127
endif()
128

129
130
131
if (HAVE_KCAL)
    target_link_libraries(KPimItinerary PUBLIC KF5::CalendarCore)
endif()
132
133
134
135
136
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()
137
138
139
if (HAVE_PHONENUMBER)
    target_link_libraries(KPimItinerary PRIVATE PhoneNumber::PhoneNumber)
endif()
140
141
142
if (HAVE_OPENSSL_RSA)
    target_link_libraries(KPimItinerary PRIVATE OpenSSL::Crypto)
endif()
143

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

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

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