Wie man CMake "Could not find a package configuration file provided by "Qt5Core" auf Ubuntu behebt?

English Deutsch

Problem:

Beim Versuch, Ihr Projekt z.B. mit

cmake_configure.sh
cmake .

zu konfigurieren, sehen Sie die folgenden Fehlermeldungen:

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.

Lösung

Installieren Sie qtbase5-dev:

install_qtbase.sh
sudo apt -y install qtbase5-dev

Check out similar posts by category: C/C++, CMake