cmakesdl-2vtkhtc-viveopenvr

using vtk with openVR


I'm trying to use VTK 7.1.1 with OpenVR on HTC Vive device. I have configured VTK using CMake 3.3.0 and built its solution using Visual Studio 2012. But when I tried to generate the solution for the example file in VTK-7.1.1/Rendering/OpenVR through CMake, it gave the following error:

Could not find a package configuration file provided by "OpenVR" with any of the following names:

OpenVRConfig.cmake
openvr-config.cmake

In addition to this CMake insisted for openvr_dir path to be manually set but did not accept the path pointing to openvr_master folder having the required contents.

How do I fix this?


Solution

  • It is usual to see a message complaining that OpenVRConfig.cmake was not found the first time you run cmake-gui after enabling OpenVR support. A new cache variable, OPENVR_ROOT_DIR, should appear. Point it to the directory containing the OpenVR SDK. I don't know where openvr_dir is coming from. You can see here (FindOpenVR.cmake in VTK7.1.1) how CMake uses OPENVR_ROOT_DIR to find libraries and include paths relative to the SDK root.

    Also, what do you mean cmake "did not accept the path point to openvr_master folder"? Did it continue complaining that OpenVR was missing? Reset OPENVR_ROOT_DIR to NOTFOUND? Something else?