CMake could not find the VTKConfig.cmake

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

I'm trying to compile a program in CMake but I'm getting this error.

By not providing "FindVTK.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "VTK", but CMake did not find one.  Could not find a package configuration file provided by "VTK" (requested version 6.1) with any of the following names:  VTKConfig.cmake vtk-config.cmake 

I can't find the relevant files (VTKConfig.cmake or vtk-config.cmake) on the machine but do have VTKConfig.cmake.in (which also doesn't work). Does anyone know where I can download the file form, or what I might be doing wrong.

回答1:

It seems like you just have the VTK source code but haven't built it yet. VTKConfig.cmake.in is a template used by CMake to generate the VTKConfig.cmake file in the build and install directory. Look at http://www.vtk.org/Wiki/VTK/Building to see how to build VTK.



回答2:

When you have successfully built VTK you can give CMake a hint where to look for VTK with the VTK_DIR-parameter:

cmake -DVTK_DIR=/path/to/vtk/build-directory /path/to/your/source-directory 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!