2015-02-12 211 views
1

我想在CMake中编译一个程序,但我得到这个错误。CMake无法找到VTKConfig.cmake

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 

我无法在机器上找到相关的文件(VTKConfig.cmake或VTK-config.cmake),但确实有VTKConfig.cmake.in(这也不起作用)。 有谁知道我可以在哪里下载文件格式,或者我可能会做错什么。

回答

4

看起来你只是有VTK源代码,但还没有建立它。 VTKConfig.cmake.in是CMake用于在构建和安装目录中生成VTKConfig.cmake文件的模板。看看http://www.vtk.org/Wiki/VTK/Building看看如何构建VTK。

2

当你已经成功构建VTK你可以给CMake的一个提示到哪里寻找VTK与VTK_DIR -parameter:

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