Skip to content

Commit

Permalink
Fix old Qt version support for usage in linux distributions (maplibre#58
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ntadej authored Oct 31, 2023
1 parent 80a1d81 commit 397242e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ releases in the upcoming version 3.0 of the Qt bindings and Qt Location plugin.
## Qt support

This library fully supports Qt 6.5 and newer.
Qt 5.15 is fully supported only on desktop platforms.
Qt 5.15 is fully supported only on desktop platforms, previous Qt 5 versions
down to 5.6 only support widgets but not Qt Location.

## How to build?

Expand Down
6 changes: 3 additions & 3 deletions src/location/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ target_link_libraries(
Location
PRIVATE
Core
$<$<BOOL:${Qt6_FOUND}>:Qt::OpenGL>
Qt::Network
Qt::LocationPrivate
$<$<BOOL:${Qt6_FOUND}>:Qt${QT_VERSION_MAJOR}::OpenGL>
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::LocationPrivate
)

# Apple specifics
Expand Down
6 changes: 3 additions & 3 deletions src/location/plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ target_link_libraries(
${MLN_QT_GEOSERVICES_PLUGIN}
PRIVATE
Location
Qt::Location
Qt::LocationPrivate)
Qt${QT_VERSION_MAJOR}::Location
Qt${QT_VERSION_MAJOR}::LocationPrivate)

# QtLocation plugin installation
install(
Expand Down Expand Up @@ -88,7 +88,7 @@ target_link_libraries(
${MLN_QT_QML_PLUGIN}
PRIVATE
Location
Qt::LocationPrivate
Qt${QT_VERSION_MAJOR}::LocationPrivate
)

# QtLocation QML extension plugin installation
Expand Down
2 changes: 1 addition & 1 deletion test/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ else()
endif()

find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickTest REQUIRED)
target_link_libraries(test_mln_qml PRIVATE Qt::QuickTest)
target_link_libraries(test_mln_qml PRIVATE Qt${QT_VERSION_MAJOR}::QuickTest)

add_test(NAME test_mln_qml COMMAND $<TARGET_FILE:test_mln_qml> -input ${CMAKE_CURRENT_SOURCE_DIR}/qt${QT_VERSION_MAJOR})
set_tests_properties(
Expand Down
2 changes: 1 addition & 1 deletion test/widgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Test REQUIRED)
target_link_libraries(
test_mln_widgets
PRIVATE
Qt::Test
Qt${QT_VERSION_MAJOR}::Test
Widgets
)
set_target_properties(test_mln_widgets PROPERTIES AUTOMOC ON)
Expand Down
2 changes: 1 addition & 1 deletion vendor/maplibre-native

0 comments on commit 397242e

Please sign in to comment.