Search code examples
cmakeqt5qtquick2qt-quickubuntu-20.04

Which dev packages are needed to build a QtQuick application on Ubuntu 20.04?


I created a template QtQuick project (for CMake) in Qt Creator and it builds fine in the IDE with "official" Qt SDK.

However, when trying to build in CLI against the system Qt in Ubuntu 20.04 I get:

$ mkdir build
$ cd build
$ cmake ..
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake:28 (find_package):
  Could not find a package configuration file provided by "Qt5Quick" with any
  of the following names:

    Qt5QuickConfig.cmake
    qt5quick-config.cmake

  Add the installation prefix of "Qt5Quick" to CMAKE_PREFIX_PATH or set
  "Qt5Quick_DIR" to a directory containing one of the above files.  If
  "Qt5Quick" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:28 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/juzzlin/QmlTest/build/CMakeFiles/CMakeOutput.log".

What is it that I need to install in addition to qt5-default and qtquickcontrols2-5-dev (not sure if this is needed) ?


Solution

  • The missing package was qtdeclarative5-dev.