Commit 2797e64e authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 2ddcd902
Pipeline #160731 passed with stages
in 3 minutes and 12 seconds
......@@ -12,7 +12,7 @@ project(KOSMIndoorMap VERSION ${RELEASE_SERVICE_VERSION})
option(BUILD_STANDALONE_APP "Build and install the stand-alone test/demo app." OFF)
find_package(ECM 5.89 REQUIRED NO_MODULE)
find_package(ECM 5.90 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
include(KDECompilerSettings NO_POLICY_SCOPE)
......@@ -32,8 +32,8 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KOSMINDOORMAP
SOVERSION 1
)
find_package(Qt5 5.15 REQUIRED COMPONENTS Quick)
find_package(Qt5 5.15 OPTIONAL_COMPONENTS Widgets)
find_package(Qt${QT_MAJOR_VERSION} 5.15 REQUIRED COMPONENTS Quick)
find_package(Qt${QT_MAJOR_VERSION} 5.15 OPTIONAL_COMPONENTS Widgets)
find_package(KF5 REQUIRED COMPONENTS I18n)
find_package(KPublicTransport REQUIRED)
find_package(KOpeningHours)
......@@ -45,10 +45,10 @@ endif()
if (BUILD_STANDALONE_APP)
if (NOT ANDROID)
find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_MAJOR_VERSION} 5.15 REQUIRED COMPONENTS Widgets)
else()
find_package(KF5 REQUIRED COMPONENTS Kirigami2)
find_package(Qt5 5.15 REQUIRED COMPONENTS QuickControls2 Svg)
find_package(Qt${QT_MAJOR_VERSION} 5.15 REQUIRED COMPONENTS QuickControls2 Svg)
find_package(OpenSSL REQUIRED)
if (NOT DEFINED BREEZEICONS_DIR AND EXISTS ${CMAKE_SOURCE_DIR}/../breeze-icons)
set(BREEZEICONS_DIR ${CMAKE_SOURCE_DIR}/../breeze-icons)
......
......@@ -3,18 +3,18 @@
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)
add_subdirectory(data/platforms)
ecm_add_test(mapviewtest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(mapcssparsertest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(scenegeometrytest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(tilecachetest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(marblegeometryassemblertest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(mapleveltest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(levelparsertest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(penwidthutiltest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(platformfindertest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(platformmodeltest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMap)
ecm_add_test(osmelementinfomodeltest.cpp LINK_LIBRARIES Qt5::Test KOSMIndoorMapQuick)
ecm_add_test(mapviewtest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(mapcssparsertest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(scenegeometrytest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(tilecachetest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(marblegeometryassemblertest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(mapleveltest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(levelparsertest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(penwidthutiltest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(platformfindertest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(platformmodeltest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMap)
ecm_add_test(osmelementinfomodeltest.cpp LINK_LIBRARIES Qt::Test KOSMIndoorMapQuick)
......@@ -5,11 +5,11 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kosmindoormap\")
add_subdirectory(osm)
add_subdirectory(map)
if (TARGET Qt5::Quick)
if (TARGET Qt${QT_MAJOR_VERSION}::Quick)
add_subdirectory(map-quick)
add_subdirectory(map-publictransport-integration)
endif()
if ((NOT ANDROID AND TARGET Qt5::Widgets) OR BUILD_STANDALONE_APP)
if ((NOT ANDROID AND TARGET Qt${QT_MAJOR_VERSION}::Widgets) OR BUILD_STANDALONE_APP)
add_subdirectory(app)
endif()
if (NOT CROSS_COMPILING)
......
......@@ -10,7 +10,7 @@ target_include_directories(kosmindoormap-app PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(kosmindoormap-app PRIVATE
KOSMIndoorMap
KF5::I18n
Qt5::Quick
Qt::Quick
)
if (ANDROID)
......@@ -18,9 +18,9 @@ if (ANDROID)
# so androiddeployqt picks them up
target_link_libraries(kosmindoormap-app PRIVATE
KF5::Kirigami2
Qt5::Svg
Qt::Svg
OpenSSL::SSL
Qt5::QuickControls2
Qt::QuickControls2
)
kirigami_package_breeze_icons(ICONS
......@@ -36,7 +36,7 @@ if (ANDROID)
)
else ()
target_link_libraries(kosmindoormap-app PRIVATE
Qt5::Widgets
Qt::Widgets
)
set_target_properties(kosmindoormap-app PROPERTIES OUTPUT_NAME "kosmindoormap")
endif()
......
......@@ -11,7 +11,7 @@ add_library(kosmindoormap_kpublictransport_integration_plugin
realtimeequipmentmodel.cpp
)
target_link_libraries(kosmindoormap_kpublictransport_integration_plugin
Qt5::Qml
Qt::Qml
KOSMIndoorMap
KPublicTransport
)
......
......@@ -9,7 +9,7 @@ add_library(KOSMIndoorMapQuick STATIC
osmelementinformationmodel.cpp
)
target_link_libraries(KOSMIndoorMapQuick PUBLIC
Qt5::Quick
Qt::Quick
KF5::I18n
KF5::I18nLocaleData
KOSMIndoorMap
......
......@@ -97,8 +97,8 @@ set_target_properties(KOSMIndoorMap PROPERTIES
target_include_directories(KOSMIndoorMap PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
target_include_directories(KOSMIndoorMap PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>)
target_link_libraries(KOSMIndoorMap
PUBLIC Qt5::Gui KOSM
PRIVATE Qt5::Network Qt5::CorePrivate
PUBLIC Qt::Gui KOSM
PRIVATE Qt::Network Qt::CorePrivate
)
if (TARGET KOpeningHours)
target_link_libraries(KOSMIndoorMap PRIVATE KOpeningHours)
......
......@@ -38,7 +38,7 @@ set_target_properties(KOSM PROPERTIES
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})
ecm_generate_headers(KOSM_FORWARDING_HEADERS
HEADER_NAMES
......
......@@ -6,4 +6,4 @@ target_link_libraries(overpassql-cli KOSM)
add_executable(indoormap indoormap.cpp ../src/map/assets/assets.qrc)
target_compile_definitions(indoormap PRIVATE -DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(indoormap KOSMIndoorMap Qt5::Widgets)
target_link_libraries(indoormap KOSMIndoorMap Qt::Widgets)
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