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

English Deutsch

Problem:

Wenn Sie versuchen, Ihr CMake-Projekt zu kompilieren, sehen Sie eine Fehlermeldung wie

vtk_error.txt
CMake Error at cMake/FreeCAD_Helpers/SetupSalomeSMESH.cmake:29 (find_package):
  Could not find a package configuration file provided by "VTK" with any of
  the following names:

    VTKConfig.cmake
    vtk-config.cmake

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

Lösung

install_libvtk9_dev.sh
sudo apt -y install libvtk9-dev

Beachten Sie, dass Sie abhängig von der Ubuntu-Version, die Sie verwenden, möglicherweise eine leicht abweichende Version (9) von vtk verwenden müssen. libvtk9-dev funktioniert für Ubuntu 22.04


Check out similar posts by category: CMake, Linux