Commit 78f939cd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent a1096222
......@@ -35,10 +35,10 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KPUBLICTRANSPORT
SOVERSION 1
)
find_package(Qt5 5.15 REQUIRED COMPONENTS Quick)
find_package(Qt${QT_MAJOR_VERSION} 5.15 REQUIRED COMPONENTS Quick)
if (BUILD_TESTING)
find_package(Qt5 5.15 REQUIRED COMPONENTS Test Widgets)
find_package(Qt${QT_MAJOR_VERSION} 5.15 REQUIRED COMPONENTS Test Widgets)
endif()
find_package(ZLIB REQUIRED)
......
......@@ -3,45 +3,45 @@
add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
ecm_add_test(osmtypetest.cpp LINK_LIBRARIES Qt5::Test KOSM)
ecm_add_test(o5mparsertest.cpp LINK_LIBRARIES Qt5::Test KOSM)
ecm_add_test(osmtypetest.cpp LINK_LIBRARIES Qt::Test KOSM)
ecm_add_test(o5mparsertest.cpp LINK_LIBRARIES Qt::Test KOSM)
ecm_add_test(kgraphqlminimizertest.cpp LINK_LIBRARIES Qt5::Test KGraphQL)
ecm_add_test(kgraphqlminimizertest.cpp LINK_LIBRARIES Qt::Test KGraphQL)
ecm_add_test(indexeddatatabletest.cpp LINK_LIBRARIES Qt5::Test)
ecm_add_test(indexeddatatabletest.cpp LINK_LIBRARIES Qt::Test)
ecm_add_test(polylinetest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(ifopttest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(uicstationcodetest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(uicrailwaycoachtest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(mergeutiltest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(locationtest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(linetest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(departuretest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(journeytest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(journeyrequesttest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(platformtest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(notestest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(backendtest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(linemetadatatest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(networkconfigtest.cpp LINK_LIBRARIES Qt5::Test)
ecm_add_test(vehiclelayoutquerymodeltest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(locationhistorymodeltest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(polylinetest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(ifopttest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(uicstationcodetest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(uicrailwaycoachtest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(mergeutiltest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(locationtest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(linetest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(departuretest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(journeytest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(journeyrequesttest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(platformtest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(notestest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(backendtest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(linemetadatatest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(networkconfigtest.cpp LINK_LIBRARIES Qt::Test)
ecm_add_test(vehiclelayoutquerymodeltest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(locationhistorymodeltest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(navitiaparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(hafasmgateparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(hafasqueryparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(hafasvehiclelayoutparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(efaparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(deutschebahntest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(otpparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(oebbparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(ivvassparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(gbfsreadertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(ojprequesttest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(ojpparsertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(navitiaparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(hafasmgateparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(hafasqueryparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(hafasvehiclelayoutparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(efaparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(deutschebahntest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(otpparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(oebbparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(ivvassparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(gbfsreadertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(ojprequesttest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(ojpparsertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(publictransportmanagertest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(cachetest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(gbfstest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(accessibilitycloudtest.cpp LINK_LIBRARIES Qt5::Test KPublicTransport)
ecm_add_test(publictransportmanagertest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(cachetest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(gbfstest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
ecm_add_test(accessibilitycloudtest.cpp LINK_LIBRARIES Qt::Test KPublicTransport)
......@@ -9,7 +9,7 @@ if (NOT CMAKE_CROSSCOMPILING)
endif()
add_subdirectory(lib)
add_subdirectory(qmlplugin)
if (TARGET Qt5::Quick)
if (TARGET Qt::Quick)
add_subdirectory(quick)
endif()
if (NOT CMAKE_CROSSCOMPILING)
......
......@@ -8,4 +8,4 @@ add_executable(line-data-generator
indexeddatatable.h
lineinfo.h
)
target_link_libraries(line-data-generator KOSM KWikidata Qt5::Gui)
target_link_libraries(line-data-generator KOSM KWikidata Qt::Gui)
......@@ -7,7 +7,7 @@ add_library(KGraphQL STATIC
kgraphql.h
kgraphqlminimizer_p.h
)
target_link_libraries(KGraphQL PUBLIC Qt5::Network)
target_link_libraries(KGraphQL PUBLIC Qt::Network)
if (NOT BUILD_SHARED_LIBS)
install(TARGETS KGraphQL EXPORT KPublicTransportTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -134,11 +134,11 @@ set_target_properties(KPublicTransport PROPERTIES
target_include_directories(KPublicTransport PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")
target_link_libraries(KPublicTransport
PUBLIC
Qt5::Gui
Qt::Gui
PRIVATE
KGraphQL
KOSM
Qt5::Network
Qt::Network
ZLIB::ZLIB
)
......
......@@ -31,7 +31,7 @@ add_library(KOSM STATIC
target_include_directories(KOSM PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>")
target_include_directories(KOSM PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(KOSM PUBLIC Qt5::Core PRIVATE Qt5::Network ${EXTRA_LIBS})
target_link_libraries(KOSM PUBLIC Qt::Core PRIVATE Qt::Network ${EXTRA_LIBS})
if (NOT BUILD_SHARED_LIBS)
install(TARGETS KOSM EXPORT KPublicTransportTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -2,7 +2,7 @@
# SPDX-License-Identifier: BSD-3-Clause
add_executable(endpointprobe endpointprobe.cpp)
target_link_libraries(endpointprobe Qt5::Network)
target_link_libraries(endpointprobe Qt::Network)
add_custom_target(run-endpoint-probe COMMAND endpointprobe ${CMAKE_SOURCE_DIR}/src/lib/networks)
add_executable(otpprobe
......@@ -10,17 +10,17 @@ add_executable(otpprobe
../lib/geo/geojson.cpp
../lib/geo/convexhull.cpp
)
target_link_libraries(otpprobe Qt5::Gui Qt5::Network)
target_link_libraries(otpprobe Qt::Gui Qt::Network)
add_custom_target(run-otp-probe COMMAND otpprobe ${CMAKE_SOURCE_DIR}/src/lib/networks)
add_executable(gbfsprobe gbfsprobe.cpp)
target_link_libraries(gbfsprobe Qt5::Network KPublicTransport)
target_link_libraries(gbfsprobe Qt::Network KPublicTransport)
add_custom_target(run-gbfs-probe COMMAND gbfsprobe ${CMAKE_SOURCE_DIR}/src/lib/gbfs/gbfs-feeds.json WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(hafas-mgate-probe
hafas-mgate-probe.cpp
)
target_link_libraries(hafas-mgate-probe PRIVATE Qt5::Gui Qt5::Network KPublicTransport)
target_link_libraries(hafas-mgate-probe PRIVATE Qt::Gui Qt::Network KPublicTransport)
add_custom_target(run-hafas-mgate-probe COMMAND hafas-mgate-probe)
if (TARGET PolyClipping::PolyClipping)
......@@ -29,6 +29,6 @@ if (TARGET PolyClipping::PolyClipping)
polygonsimplifier.cpp
../lib/geo/geojson.cpp
)
target_link_libraries(transport-api-sync Qt5::Gui KOSM PolyClipping::PolyClipping)
target_link_libraries(transport-api-sync Qt::Gui KOSM PolyClipping::PolyClipping)
add_custom_target(run-transport-api-sync COMMAND transport-api-sync --config-path ${CMAKE_SOURCE_DIR}/src/lib/networks --transport-apis ${CMAKE_CURRENT_BINARY_DIR}/transport-apis)
endif()
......@@ -12,6 +12,6 @@ add_library(KWikidata STATIC
target_include_directories(KOSM PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>")
target_link_libraries(KWikidata
PUBLIC Qt5::Gui
PRIVATE Qt5::Network
PUBLIC Qt::Gui
PRIVATE Qt::Network
)
......@@ -2,23 +2,23 @@
# SPDX-License-Identifier: BSD-3-Clause
add_executable(querytest querytest.cpp)
target_link_libraries(querytest Qt5::Test KPublicTransport)
target_link_libraries(querytest Qt::Test KPublicTransport)
add_custom_target(run-querytest COMMAND querytest)
add_executable(departurequery departurequery.cpp departurequery.qrc)
target_link_libraries(departurequery KPublicTransport Qt5::Quick Qt5::Widgets)
target_link_libraries(departurequery KPublicTransport Qt::Quick Qt::Widgets)
add_executable(journeyquery journeyquery.cpp journeyquery.qrc)
target_link_libraries(journeyquery KPublicTransport Qt5::Quick Qt5::Widgets)
target_link_libraries(journeyquery KPublicTransport Qt::Quick Qt::Widgets)
add_executable(locationquery locationquery.cpp locationquery.qrc)
target_link_libraries(locationquery KPublicTransport Qt5::Quick Qt5::Widgets)
target_link_libraries(locationquery KPublicTransport Qt::Quick Qt::Widgets)
add_executable(locationcompleter locationcompleter.cpp)
target_link_libraries(locationcompleter KPublicTransport Qt5::Widgets)
target_link_libraries(locationcompleter KPublicTransport Qt::Widgets)
add_executable(gbfsdiscover gbfsdiscover.cpp)
target_link_libraries(gbfsdiscover KPublicTransport Qt5::Network)
target_link_libraries(gbfsdiscover KPublicTransport Qt::Network)
add_executable(graphql-cli graphql-cli.cpp)
target_link_libraries(graphql-cli KGraphQL)
......
Supports Markdown
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