Wie man CMake 'Could not find a package configuration file provided by "yaml-cpp" ...' auf Ubuntu behebt

English Deutsch

Problem:

Wenn Sie versuchen, ein CMake-Projekt zu bauen, sehen Sie eine Fehlermeldung wie

CMake Error at cMake/FreeCAD_Helpers/SetupLibYaml.cmake:3 (find_package): By not providing “Findyaml-cpp.cmake” in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by “yaml-cpp”, but CMake did not find one.

cmake_yaml_cpp_error.txt
CMake Error at cMake/FreeCAD_Helpers/SetupLibYaml.cmake:3 (find_package):
  By not providing "Findyaml-cpp.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "yaml-cpp",
  but CMake did not find one.

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

    yaml-cppConfig.cmake
    yaml-cpp-config.cmake

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

oder

yaml_cpp_include_error.txt
No such file or directory
   34 | #include <yaml-cpp/yaml.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.

Lösung

install_libyaml_cpp_dev.sh
sudo apt -y install libyaml-cpp-dev

Check out similar posts by category: CMake, Linux