Jak opravit CMake "Could not find a package configuration file provided by "Qt5Core" na Ubuntu?

Problém:

Při pokusu o configure váš project pomocí např.

cmake_configure.sh
cmake .

vidíte následující error messages:

cmake_find_qt_error.txt
CMake Warning at CMakeLists.txt:120 (find_package):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core" with any
  of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.

Řešení

Nainstalujte qtbase5-dev:

install_qtbase.sh
sudo apt -y install qtbase5-dev

Podívejte se na podobné články podle kategorie: C/C++ CMake