diff options
Diffstat (limited to 'examples/sensors/sensor_explorer/CMakeLists.txt')
-rw-r--r-- | examples/sensors/sensor_explorer/CMakeLists.txt | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/examples/sensors/sensor_explorer/CMakeLists.txt b/examples/sensors/sensor_explorer/CMakeLists.txt index 3440f79b..32a2ab8a 100644 --- a/examples/sensors/sensor_explorer/CMakeLists.txt +++ b/examples/sensors/sensor_explorer/CMakeLists.txt @@ -13,11 +13,13 @@ endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/sensors/sensor_explorer") -find_package(Qt6 COMPONENTS Qml Quick) +find_package(Qt6 COMPONENTS Qml Quick Sensors) qt_add_executable(sensor_explorer main.cpp + sensormodels.cpp sensormodels.h ) + set_target_properties(sensor_explorer PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -25,9 +27,9 @@ set_target_properties(sensor_explorer PROPERTIES target_link_libraries(sensor_explorer PUBLIC Qt::Qml Qt::Quick + Qt::Sensors ) - # Resources: set(qml_resource_files "sensor_explorer.qml" @@ -40,15 +42,15 @@ qt6_add_resources(sensor_explorer "qml" ${qml_resource_files} ) -if(TARGET Qt::Widgets) - target_link_libraries(sensor_explorer PUBLIC - Qt::Widgets - ) -endif() - install(TARGETS sensor_explorer RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" ) -add_subdirectory(import) + +set_target_properties(sensor_explorer PROPERTIES + QT_QML_MODULE_VERSION 1.0 + QT_QML_MODULE_URI SensorModels +) + +qt_qml_type_registration(sensor_explorer) |