I’m trying to build an application with Qt, using cmake on Linux (Ubuntu 23.04).
For the Qt part, I want to use Qml.
Inside my CMakeLists.txt
file, I’ve got find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui Qml Quick)
. When running ccmake
and configure, I’ve got this error:
Failed to find required Qt component "Qml".
(I’ve got the same error with Quick, if I remove Qml from find_package)
Here is all qt6 modules that are installed (got it with apt list --installed | grep "qt6"
)
libqt6concurrent6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6core6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6dbus6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6gui6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6network6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6opengl6-dev/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6opengl6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6openglwidgets6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6printsupport6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6qml6/lunar,now 6.4.2+dfsg-1 amd64 [installé, automatique] <-
libqt6qmlmodels6/lunar,now 6.4.2+dfsg-1 amd64 [installé, automatique] <-
libqt6quick6/lunar,now 6.4.2+dfsg-1 amd64 [installé] <-
libqt6sql6-sqlite/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6sql6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6test6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6widgets6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
libqt6xml6/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
qml-qt6/lunar,now 6.4.2+dfsg-1 amd64 [installé]
qt6-base-dev-tools/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
qt6-base-dev/lunar,now 6.4.2+dfsg-6 amd64 [installé]
qt6-gtk-platformtheme/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
qt6-qpa-plugins/lunar,now 6.4.2+dfsg-6 amd64 [installé, automatique]
qt6-translations-l10n/lunar,lunar,now 6.4.2-1 all [installé, automatique]
Here is the list of all cmake configuration directories for Qt modules (found in dir /usr/lib/x86_64-linux-gnu/cmake/
)
Qt6
Qt6BuildInternals
Qt6Concurrent
Qt6Core
Qt6CoreTools
Qt6DBus
Qt6DBusTools
Qt6DeviceDiscoverySupportPrivate
Qt6EglFSDeviceIntegrationPrivate
Qt6EglFsKmsGbmSupportPrivate
Qt6EglFsKmsSupportPrivate
Qt6FbSupportPrivate
Qt6Gui
Qt6GuiTools
Qt6HostInfo
Qt6InputSupportPrivate
Qt6KmsSupportPrivate
Qt6Network
Qt6OpenGL
Qt6OpenGLWidgets
Qt6PrintSupport
Qt6Sql
Qt6Test
Qt6Widgets
Qt6WidgetsTools
Qt6XcbQpaPrivate
Qt6Xml
There is no Qml and Quick folders, which explain why cmake complains. But I don’t understand why these configs are missing!
What am I missing?