Qt 6.11 is out! See what's new in the release
blog
Creating QML plugin for QSensor
-
Hi everyone,
I'm trying to build a QML plugin for a QSensor.
Following this blog post: https://www.qt.io/blog/qml-modules-in-qt-6.2 I managed to create a QML plugin based on QObject.But when I add
target_link_libraries(mylib PRIVATE Qt6::Sensors)to the CMakeLists.txt of the plugin I end up with the error message:
<path>/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:617: error: get_target_property() called with non-existent target "Qt6::Sensors". <path>/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:705 (_qt_internal_finalize_executable) <path>/lib/cmake/Qt6Core/Qt6CoreMacros.cmake:685:EVAL:1 (qt6_finalize_target) CMakeLists.txt:DEFERREDWhen the target is an executable linking the Qt6::Sensors library works fine.
Can anybody help me solve this?
-
Hi and welcome to devnet,
Might be a silly question but do you have something along the lines of:
find_package(Qt6 REQUIRED COMPONENTS Sensors)in your plugin project ?
-