Building from source - HipsterSloth/PSVRTracker GitHub Wiki
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.
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
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.
-
CMake
- 3.6.1 works as of this writing.
- Compiler - Visual Studio 14 2015
- 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
- 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.
- 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.
- 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)
- Create Visual Studio project files
cd ../../..
mkdir build && cd build
cmake -G "Visual Studio 14 2015 Win64" ..
- Open <path_to_repo>\build\PSVRTracker.sln
- Change to "Release" configuration
- Rt-click on the OpenCV External project and build
- This will download OpenCV 3.1 into the /deps folder and compile it
- Rt-click on the PSVRTracker solution and build (or do a "Build All..." from the build menu)
- Rt-click on the "INSTALL" project and build
- Compiler
- Tested with XCode/clang. gcc may work.
- 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
- Eigen3
brew install eigen
- OpenCV
brew tap homebrew/science
brew install opencv3 --HEAD --without-test
- 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
- Currently I am using brew's libusb (
- Optional: SDL2
- Optional - Only required if you are building the the configuration tool.
brew install SDL2
mkdir build && cd build
cmake .. -G Xcode
- Launch Xcode
- Open <path_to_repo>\build\PSVRTracker.xcodeproj
- Go to "Product" > "Build" or hit -B