How to add Qt Bluetooth module to CMake?
Solved
General and Desktop
-
I am not able to add activate Bluetooth module to add cmake file.
the line in cmakefile
find_package(Qt5 COMPONENTS Widgets Qml Quick Bluetooth REQUIRED)
error
/usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:26: error: Could not find a package configuration file provided by "Qt5Bluetooth" with any of the following names: Qt5BluetoothConfig.cmake qt5bluetooth-config.cmake Add the installation prefix of "Qt5Bluetooth" to CMAKE_PREFIX_PATH or set "Qt5Bluetooth_DIR" to a directory containing one of the above files. If "Qt5Bluetooth" provides a separate development package or SDK, be sure it has been installed. qt_demo/CMakeLists.txt:20 (find_package)
-
Hi,
Maybe a silly question but did you install the
qtconnectivity5-dev
(or your distribution equivalent) package ? -
@SGaist said in How to add Qt Bluetooth module to CMake?:
qtconnectivity5
:) yes, it was the issue, but It does not make sense to me. I installed Qt with maintenance tool, and I am able to compile code with .pro configuration. Any idea?
Now, there is another problem.
new error
error: QtBluetooth/qtbluetooth-config.h: No such file or directory #include <QtBluetooth/qtbluetooth-config.h> ^
thanks in advance
-
What version did you install ?
Where are you calling cmake from ?
-
What version of cmake are you using ?
-
i know this is an old thread but I am replying for any body in future searching for it
add the following to your cmake file
target_link_libraries(project PRIVATE Qt5::Core Qt5::Quick Qt5::Bluetooth )