tree: 8657df274fc1004900179020e079e5e5ff00fa5d [path history] [tgz]
  1. bin/
  2. driver_sample/
  3. hellovr_dx12/
  4. hellovr_opengl/
  5. hellovr_vulkan/
  6. helloworldoverlay/
  7. shared/
  8. thirdparty/
  9. tracked_camera_openvr_sample/
  10. unity_keyboard_sample/
  11. unity_teleport_sample/
  12. CMakeLists.txt
  13. README.md
  14. samples_vs2010.sln
samples/README.md

OpenVR Samples: CMake build guide.

Support

Configuration3264
GNU/Linux (gcc 4.8+)OKOK
Windows (msvc 12)OKOK
OSX (clang)~~

Dependencies

  • Qt 5.x
  • GLEW 1.11+
  • SDL2
  • OpenVR

The only general external dependency is Qt5.
On GNU/Linux, you will need GLEW 1.11 (available on most package manager).
On Windows x64, you will need the SDL2 runtime library.

Build

Important:
you might need to specify Qt5 cmake module path manually when generating the cache for the first time using the CMAKE_PREFIX_PATH macro (see examples below).

We will use the command-line on Unix and Git Bash on Windows.

First, move from the repository root to the samples directory to create a build directory:

cd samples
mkdir build; cd build

Then, depending on your system:

Unix

Generate the CMake cache using Makefile:

cmake .. -G Makefile -DCMAKE_PREFIX_PATH=/opt/Qt/5.6/gcc_64/lib/cmake -DCMAKE_BUILD_TYPE=Release

To build type:

make -j4

Windows

Generate the CMake cache using MSVC 12 for x64:

cmake .. -G "Visual Studio 12 2013 Win64" -DCMAKE_PREFIX_PATH=C:/Qt/5.6/msvc2013_64/lib/cmake

Alternatively, you can force the compilation on x86 architectures by using the PLATFORM property (be sure to use the right generator and Qt binaries):

cmake .. -G "Visual Studio 12 2013" -DCMAKE_PREFIX_PATH=C:/Qt/5.6/msvc2013/lib/cmake -DPLATFORM=32

To build, simply type:

cmake --build . --target all --config Release

Note : using CMake, the build configuration type (ie. Debug, Release) is set at Build Time with MSVC and at Cache Generation Time with Makefile.