Commit 0efe9f75 authored by Volker Krause's avatar Volker Krause
Browse files

Fully separate library and code generator/tools code

parent 1ddc6a02
Pipeline #51354 passed with stage
in 10 minutes and 48 seconds
......@@ -16,8 +16,8 @@ ecm_add_test(bcbpparsertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(uic9183parsertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(vdvtickettest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(rct2parsertest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(jsapitest.cpp ../src/jsapi/jsonld.cpp TEST_NAME jsapitest LINK_LIBRARIES Qt5::Test KPim::Itinerary Qt5::Qml)
ecm_add_test(bitarraytest.cpp ../src/jsapi/bitarray.cpp TEST_NAME bitarraytest LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(jsapitest.cpp ../src/lib/jsapi/jsonld.cpp TEST_NAME jsapitest LINK_LIBRARIES Qt5::Test KPim::Itinerary Qt5::Qml)
ecm_add_test(bitarraytest.cpp ../src/lib/jsapi/bitarray.cpp TEST_NAME bitarraytest LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(structureddataextractortest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
ecm_add_test(pdfdocumenttest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary Qt5::Gui)
ecm_add_test(htmldocumenttest.cpp LINK_LIBRARIES Qt5::Test KPim::Itinerary)
......
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include <../src/jsapi/bitarray.h>
#include <../src/lib/jsapi/bitarray.h>
#include <QByteArray>
#include <QDebug>
......
......@@ -4,7 +4,7 @@
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include <../src/jsapi/jsonld.h>
#include <../src/lib/jsapi/jsonld.h>
#include <QDebug>
#include <QJSEngine>
......
add_subdirectory(cli)
# SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(osm)
if (TARGET Qt5::Network AND NOT CMAKE_CROSSCOMPILING AND OSM_PLANET_DIR AND OsmTools_FOUND)
add_subdirectory(knowledgedb-generator)
endif()
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
generic/genericextractor.cpp
generic/genericicalextractor.cpp
generic/genericpdfextractor.cpp
generic/genericpkpassextractor.cpp
generic/genericuic918extractor.cpp
generic/genericvdvextractor.cpp
generic/structureddataextractor.cpp
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
pdf/pdfdocument.cpp
pdf/pdfextractoroutputdevice.cpp
pdf/pdfimage.cpp
pdf/pdfvectorpicture.cpp
pdf/popplerglobalparams.cpp
pdf/popplerutils.cpp
tlv/berelement.cpp
uic9183/rct2ticket.cpp
uic9183/uic9183block.cpp
uic9183/uic9183parser.cpp
uic9183/uic9183ticketlayout.cpp
uic9183/vendor0080block.cpp
vdv/iso9796_2decoder.cpp
vdv/vdvcertificate.cpp
vdv/vdvticket.cpp
vdv/vdvticketparser.cpp
vdv/certs/vdv-certs.qrc
barcodedecoder.cpp
calendarhandler.cpp
documentutil.cpp
extractor.cpp
extractorcapabilities.cpp
extractorengine.cpp
extractorfilter.cpp
extractorinput.cpp
extractorpostprocessor.cpp
extractorrepository.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
extractors/extractors.qrc
)
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})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KPimItinerary PROPERTIES UNITY_BUILD ON)
endif()
add_library(KPim::Itinerary ALIAS KPimItinerary)
generate_export_header(KPimItinerary BASE_NAME KItinerary)
set_target_properties(KPimItinerary PROPERTIES
VERSION ${KITINERARY_VERSION_STRING}
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
Extractor
ExtractorCapabilities
ExtractorEngine
ExtractorFilter
ExtractorInput
ExtractorPostprocessor
ExtractorRepository
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
)
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
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}
${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}
${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()
add_subdirectory(lib)
add_subdirectory(cli)
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
generic/genericextractor.cpp
generic/genericicalextractor.cpp
generic/genericpdfextractor.cpp
generic/genericpkpassextractor.cpp
generic/genericuic918extractor.cpp
generic/genericvdvextractor.cpp
generic/structureddataextractor.cpp
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
pdf/pdfdocument.cpp
pdf/pdfextractoroutputdevice.cpp
pdf/pdfimage.cpp
pdf/pdfvectorpicture.cpp
pdf/popplerglobalparams.cpp
pdf/popplerutils.cpp
tlv/berelement.cpp
uic9183/rct2ticket.cpp
uic9183/uic9183block.cpp
uic9183/uic9183parser.cpp
uic9183/uic9183ticketlayout.cpp
uic9183/vendor0080block.cpp
vdv/iso9796_2decoder.cpp
vdv/vdvcertificate.cpp
vdv/vdvticket.cpp
vdv/vdvticketparser.cpp
vdv/certs/vdv-certs.qrc
barcodedecoder.cpp
calendarhandler.cpp
documentutil.cpp
extractor.cpp
extractorcapabilities.cpp
extractorengine.cpp
extractorfilter.cpp
extractorinput.cpp
extractorpostprocessor.cpp
extractorrepository.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
extractors/extractors.qrc
)
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})
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
set_target_properties(KPimItinerary PROPERTIES UNITY_BUILD ON)
endif()
add_library(KPim::Itinerary ALIAS KPimItinerary)
generate_export_header(KPimItinerary BASE_NAME KItinerary)
set_target_properties(KPimItinerary PROPERTIES
VERSION ${KITINERARY_VERSION_STRING}
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
Extractor
ExtractorCapabilities
ExtractorEngine
ExtractorFilter
ExtractorInput
ExtractorPostprocessor
ExtractorRepository
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
)
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
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}
${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}
${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()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment