1

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?

Community
  • 1
  • 1

1 Answers1

1

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?

Drone2537
  • 525
  • 3
  • 12
  • Yes,I have set OPENVR_ROOT_DIR, OPENVR_HEADERS_ROOT_DIR , OPENVR_INCLUDE_DIR, OPENVR_LIBRARY paths just after enabling OpenVR support.Also i went through the FindOpenVR.cmake as u suggested but everything seemed right there.. – anusha kamath Jul 03 '17 at 05:13
  • CMake continued complaing CMake Error at CMakeLists.txt:6 (find_package): By not providing "FindOpenVR.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "OpenVR", but CMake did not find one. Could not find a package configuration file provided by "OpenVR" with any of the following names: OpenVRConfig.cmake openvr-config.cmake Add the installation prefix of "OpenVR" to CMAKE_PREFIX_PATH or set "OpenVR_DIR" to a directory containing one of the above files. – anusha kamath Jul 03 '17 at 05:26
  • @anushakamath Try adding `message("Looking for library in ${_libdir}, root dirs ${_root_dirs}")` at line 67 of VTK's [FindOpenVR.cmake](https://gitlab.kitware.com/vtk/vtk/blob/v7.1.1/CMake/FindOpenVR.cmake#L67). Does the library directory match your architecture and contain the openvr_api shared library/dll? Does the list of root directories reported include a `headers/openvr_driver.h` file? – Drone2537 Jul 03 '17 at 18:59
  • Thank you for the suggestion @Drone2537!! root dirs reported point to the folder having openvr_driver.h .But _libdir is not set, hence it's value is not displayed in the statement you suggested.I have set OPENVR_LIBRARY pointing to openvr_api .lib after enabling OpenVR support for the first time.Can u please tell me what could have gone wrong? – anusha kamath Jul 04 '17 at 08:37
  • The variable OPENVR_LIBRARY_TEMP in FindOpenVR.cmake holds the path pointing openvr_api.lib – anusha kamath Jul 04 '17 at 09:59