Unable to include QtQuickWidgets in cmake
-
Hi,
I have Qt Widget Application which is running on ubuntu.
(Qt version : Qt5.12 , OS : Ubuntu 20.04.5 LTS)
We build application using cmake.
Now I want to use Qml files in my QtWidgets application.
To include QtQuickWidgets I tried like below,find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets Core OpenGL QuickWidgets)
find_package(Qt5 REQUIRED COMPONENTS Widgets Core OpenGL QuickWidgets)target_link_libraries(${app_name}
Qt5::Core
Qt5::OpenGL
Qt5::Widgets
Qt5::QuickWidgets)I am getting error as,
Could not find a package configuration file provided by "Qt5QuickWidgets"
with any of the following names:Qt5QuickWidgetsConfig.cmake qt5quickwidgets-config.cmakeFor checking environment, I have created a simple QtWidgets application using QMake and included like below in .pro file
QT += core gui quickwidgetsIt works and I am able to use qml file in QtWidgets Application.
Please share your ideas on build error and correct way of including QtQuickWidgets in cmake.
Thanks in advance.