Building from source - HipsterSloth/PSVRTracker GitHub Wiki

Overview

This page will explain how to build the project from source on either Win10 or OS X. If all you want to do is run the project without modifications, you might instead consider downloading pre-built binaries from the Release page.

Downloading the source

Don't download the source from the green "Clone or download" button! The zip provided only contains the source from the /src folder and not the submodules in /thirdparty. This is a known issue with GitHub (we don't provide the zip file that this button generates). If you don't have a github client installed, get it from: https://desktop.github.com/

git clone --recursive https://github.com/HipsterSloth/PSVRTracker.git

cd PSVRTracker

Prerequisites and Build

Before you get started, think about whether you want to build for 32-bit or 64-bit architecture. SteamVR is 64-bit by default, so if you plan use this for an openvr plugin then you should be building for 64-bit.

Prerequisites

  1. CMake
    • 3.6.1 works as of this writing.
  2. Compiler - Visual Studio 14 2015

Initial Setup Script

  1. Run the InitialSetup_X64.bat Batch Script
    • This script will automatically configure and build the dependencies in the thirdparty folder.
    • If you want to do a 32-bit build, run the 32-bit version of the InitialSetup.
      • NOTE: This will clear out all previously built intermediates in the /build and /deps folder
    • If you would rather do initial setup by hand, then proceed to the next step
  2. After the initial setup phase, if you add source files or other CMake changes you can run GenerateProjectFiles_X64.bat to regenerate the PSVRTracker solution.

Manual Initial Setup (alternative to setup scripts)

  1. libusb
    • Only necessary for PS3EYEDriver (Required in Mac and in Windows if using 64-bit PSVRTracker)
    • Open PSMoveService\thirdparty\libusb\msvc\libusb_2015.sln
    • For each combination of Release/Debug * Win32/x64, right-click on libusb-1.0 (static) and Build.
    • Close this Visual Studio Solution.
  2. SDL2
    • Optional - Only required if you are building the configuration client. Highly recommended.
    • cd third_party/SDL2
    • mkdir build & cd build
    • cmake .. -G "Visual Studio 14 2015 Win64" -DDIRECTX=OFF -DDIRECTX=OFF -DSDL_STATIC=ON -DFORCE_STATIC_VCRT=ON -DEXTRA_CFLAGS="-MT -Z7 -DSDL_MAIN_HANDLED -DWIN32 -DNDEBUG -D_CRT_SECURE_NO_WARNINGS -DHAVE_LIBC -D_USE_MATH_DEFINES
    • Open the solution (PSMoveService\thirdparty\SDL2\build\SDL2.sln)
    • For each Release/Debug target
      • Build the SLD2-static and SDL2main projects (Not the SDL2 project)
  3. Create Visual Studio project files
    • cd ../../..
    • mkdir build && cd build
    • cmake -G "Visual Studio 14 2015 Win64" ..

Build

  1. Open <path_to_repo>\build\PSVRTracker.sln
  2. Change to "Release" configuration
  3. Rt-click on the OpenCV External project and build
  • This will download OpenCV 3.1 into the /deps folder and compile it
  1. Rt-click on the PSVRTracker solution and build (or do a "Build All..." from the build menu)
  2. Rt-click on the "INSTALL" project and build

Prerequisites

  1. Compiler
    • Tested with XCode/clang. gcc may work.
  2. Homebrew
    • I am opting for a system install of dependent libraries where possible, instead of project-specific.
    • Install homebrew if you do not already have it.
    • brew update
  3. Eigen3
    • brew install eigen
  4. OpenCV
    • brew tap homebrew/science
    • brew install opencv3 --HEAD --without-test
  5. libusb
    • Currently I am using brew's libusb (brew install libusb), but previously I had to build myself (can't remember why); see below.
    • cd thirdparty/libusb
    • ./autogen.sh
    • ./configure
    • ./configure (yes, a second time)
    • make
  6. Optional: SDL2
    • Optional - Only required if you are building the the configuration tool.
    • brew install SDL2

Generate PSVRTracker Xcode project files

  1. mkdir build && cd build
  2. cmake .. -G Xcode

Build PSVRTracker

  1. Launch Xcode
  2. Open <path_to_repo>\build\PSVRTracker.xcodeproj
  3. Go to "Product" > "Build" or hit -B
⚠️ **GitHub.com Fallback** ⚠️