Reputation: 115
I'm new to CMake. I copied a small vtk example from the link http://www.vtk.org/Wiki/VTK/Examples/Cxx/IO/SimplePointsReader and used CMake to compile. And it gives me an error, " Error in configuration process, Project files may be invalid".
It shows me the errors,
CMake Error at CMakeLists.txt:5 (find_package): 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" 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.
I have already installed vtk in my pc and please help me with this problem.
CMakeLists.txt contains the following code
cmake_minimum_required(VERSION 2.8)
PROJECT(SimplePointsReader)
find_package(VTK REQUIRED)
include(${VTK_USE_FILE})
add_executable(SimplePointsReader MACOSX_BUNDLE SimplePointsReader)
if(VTK_LIBRARIES)
target_link_libraries(SimplePointsReader ${VTK_LIBRARIES})
else()
target_link_libraries(SimplePointsReader vtkHybrid vtkWidgets)
endif()
Upvotes: 0
Views: 5094
Reputation: 11
I've solved this problem by setting VTK_DIR=path_to_VTK/bin as an environment variable, because CMakeList.txt file's changing was not helpful.
Upvotes: 1