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

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

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

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

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

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

55
56
    tlv/berelement.cpp

57
    uic9183/rct2ticket.cpp
58
    uic9183/uic9183block.cpp
59
60
    uic9183/uic9183parser.cpp
    uic9183/uic9183ticketlayout.cpp
61
    uic9183/vendor0080block.cpp
62

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

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

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

129
130
131
if (TARGET ZXing::ZXing)
    target_link_libraries(KPimItinerary PRIVATE ZXing::ZXing)
elseif (TARGET ZXing::Core)
132
    target_link_libraries(KPimItinerary PRIVATE ZXing::Core)
133
endif()
134

135
136
137
if (HAVE_KCAL)
    target_link_libraries(KPimItinerary PUBLIC KF5::CalendarCore)
endif()
138
139
140
141
142
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()
143
144
145
if (HAVE_PHONENUMBER)
    target_link_libraries(KPimItinerary PRIVATE PhoneNumber::PhoneNumber)
endif()
146
147
148
if (HAVE_OPENSSL_RSA)
    target_link_libraries(KPimItinerary PRIVATE OpenSSL::Crypto)
endif()
149

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

224
225
ecm_generate_headers(KItinerary_Vdv_FORWARDING_HEADERS
    HEADER_NAMES
Volker Krause's avatar
Volker Krause committed
226
        VdvTicket
227
228
229
230
231
232
        VdvTicketParser
    PREFIX KItinerary
    REQUIRED_HEADERS KItinerary_Vdv_HEADERS
    RELATIVE vdv
)

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