2015-02-12 330 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