summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Laanmets <lauri.laanmets@eesti.ee>2022-03-08 09:30:43 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-07-26 14:28:38 +0200
commitc4712ad8c5e7701429e9184db6ec91a4008566e2 (patch)
tree82ce229de262b75cd46ae8932153732f6a16bd96
parent24804c8b9a5651a8088bf9479990df5830473fbb (diff)
downloadqtlocation-c4712ad8c5e7701429e9184db6ec91a4008566e2.tar.gz
Manual fixes in CMake files for examples
Improvements in CMake files after they have been generated from .pro files by script. All examples except 'places' are included because 'places' example doesn't start (not ported yet). Task-number: QTBUG-96795 Pick-to: 6.2 Change-Id: I1fab82821f499f51337440274d0b66082f614fca Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--CMakeLists.txt5
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--examples/location/CMakeLists.txt20
-rw-r--r--examples/location/mapviewer/CMakeLists.txt8
-rw-r--r--src/configure.cmake2
5 files changed, 18 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f041881..5f8e7360 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,11 @@ endif()
# Otherwise we'll get an "QtPositioning not found" error in WASM build.
find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS Positioning Network) # special case
find_package(Qt6 ${PROJECT_VERSION} QUIET CONFIG OPTIONAL_COMPONENTS Quick Qml Test QuickTest PositioningQuick ShaderTools) # special case
+find_package(Qt6 ${PROJECT_VERSION} CONFIG OPTIONAL_COMPONENTS
+ # Needed when building examples in-tree
+ Widgets
+ Sql
+)
macro(assertTargets)
foreach(qtTarget IN ITEMS ${ARGN})
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 6dc8720a..24062c8a 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -1,7 +1,7 @@
# Generated from examples.pro.
qt_examples_build_begin(EXTERNAL_BUILD)
-if(TARGET Qt::Location AND TARGET Qt::Positioning)
+if(TARGET Qt::Location)
add_subdirectory(location)
endif()
qt_examples_build_end()
diff --git a/examples/location/CMakeLists.txt b/examples/location/CMakeLists.txt
index b36f5bd9..14cfd70e 100644
--- a/examples/location/CMakeLists.txt
+++ b/examples/location/CMakeLists.txt
@@ -1,14 +1,14 @@
# Generated from location.pro.
if(TARGET Qt::Quick)
- add_subdirectory(places)
- add_subdirectory(places_list)
- add_subdirectory(places_map)
-# add_subdirectory(mapviewer)
- add_subdirectory(minimal_map)
- add_subdirectory(itemview_transitions)
- add_subdirectory(planespotter)
+ #qt_internal_add_example(places) # Not ported yet
+ qt_internal_add_example(places_list)
+ qt_internal_add_example(places_map)
+ qt_internal_add_example(mapviewer)
+ qt_internal_add_example(minimal_map)
+ qt_internal_add_example(itemview_transitions)
+ qt_internal_add_example(planespotter)
+endif()
+if(TARGET Qt::Quick AND TARGET Qt::Widgets)
+ qt_internal_add_example(geojson_viewer)
endif()
-#if(TARGET Qt::Quick AND TARGET Qt::Widgets)
-# add_subdirectory(geojson_viewer)
-#endif()
diff --git a/examples/location/mapviewer/CMakeLists.txt b/examples/location/mapviewer/CMakeLists.txt
index dae0a81c..fa15dca4 100644
--- a/examples/location/mapviewer/CMakeLists.txt
+++ b/examples/location/mapviewer/CMakeLists.txt
@@ -82,18 +82,12 @@ qt6_add_resources(qml_location_mapviewer "mapviewer"
${mapviewer_resource_files}
)
-if(QT_FEATURE_geoservices_mapboxgl)
+if(QT_FEATURE_geoservices_maplibregl)
target_link_libraries(qml_location_mapviewer PUBLIC
Qt::Sql
)
endif()
-if(QT_FEATURE_geoservices_osm)
- target_link_libraries(qml_location_mapviewer PUBLIC
- Qt::Concurrent
- )
-endif()
-
install(TARGETS qml_location_mapviewer
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
diff --git a/src/configure.cmake b/src/configure.cmake
index 0c1e571f..56f950b5 100644
--- a/src/configure.cmake
+++ b/src/configure.cmake
@@ -7,5 +7,5 @@ qt_feature("location-labs-plugin" PRIVATE
qt_feature("geoservices_osm" PRIVATE
LABEL "Provides access to OpenStreetMap geoservices"
- CONDITION QT_FEATURE_concurrent
+ CONDITION TRUE
)