Required tools/libraries
- Visual Studio 2015
- Cmake 3.4.1 or upper 32bit only
- OpenCV 3.0.0 (OpenCV 3.3.1 ok)
unzip to C:/osvr/ - libfunctionality
Build number: 42, Visual Studio version: 14, Bits: 64
unzip to C:/osvr/ - jsoncpp
Build number: 18, Visual Studio version: 14, Bits: 64
unzip to C:/osvr/ - boost 1.60
unzip to C:/osvr/
1. Build boost
Use “Developer Command Prompt for VS2015”(C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\Shortcuts)
1 | cd C:/osvr/boost_1_60_0 |
2. Build OSVR-Core
目錄配置結構1
2
3
4
5
6C:\
├─ osvr
│ ├─ boost_1_60_0
│ ├─ jsoncpp-vc14-64bits-18
│ └─ libfunctionality-vc14-64bits-42
└─ opencv
輸入以下指令開始編譯 OSVR-Core1
2
3cd C:/osvr/
git clone --recursive https://github.com/OSVR/OSVR-Core.git
mkdir OSVR-Core/build
使用cmake-gui1
2
3
4source code dir = C:/osvr/OSVR-Core
build the binaries dir = C:/osvr/OSVR-Core/build
Configure
選 Visual Studio 14 2015 Win64
加入下列路徑1
2
3libfunctionality_DIR = C:/osvr/libfunctionality-binary/install/lib/cmake/libfunctionality
OpenCV_DIR = C:/osvr/opencv/build
jsoncpp_DIR = C:/osvr/jsoncpp-vc14-64bits-18/install/lib/cmake/jsoncpp
手動加入entry (click “Add Entry”, add PATH)1
2
3BOOST_LIBRARYDIR = C:/osvr/boost_1_60_0/libs
BOOST_ROOT = C:/osvr/boost_1_60_0
BOOST_INCLUDE_DIR = C:/osvr/boost_1_60_0
Configure and Generate, click osvrcore.sln and build
1 | C:\osvr\OSVR-Core\build\osvrcore.sln |
Fix compiler error (header_cpp_265, header_cpp_172) 加入opencv目錄路徑
1 | PROJECT > Properties (或在專案右鍵選Properties) |
Compile Plugin of video-based tracker
Need DirectShow (Microsoft Windows SDK Update)
確保 DIRECTSHOW_QEDIT_INCLUDE_DIR 和 DIRECTSHOW_STRMIIDS_LIBRARY 都要有值1
2DIRECTSHOW_QEDIT_INCLUDE_DIR:PATH="C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include"
DIRECTSHOW_STRMIIDS_LIBRARY:PATH="C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um/x64/strmiids.lib"
CMake Script
輸入以下腳本可以自動完成上面第2步
gen_vs2015_64.sh1
2
3
4
5
6
7
8
9
10
11
12cd OSVR-Core/build
cmake .. \
-G "Visual Studio 14 2015 Win64" \
-DCMAKE_INSTALL_PREFIX:PATH=C:/osvr/install \
-Dlibfunctionality_DIR:PATH=C:/osvr/jsoncpp-vc14-64bits-18/install/lib/cmake/libfunctionality \
-DOpenCV_DIR:PATH=C:/osvr/opencv/build \
-Djsoncpp_DIR:PATH=C:/osvr/jsoncpp-vc14-64bits-18/install/lib/cmake/jsoncpp \
-DBOOST_LIBRARYDIR:PATH=C:/osvr/boost_1_60_0/libs \
-DBOOST_ROOT:PATH=C:/osvr/boost_1_60_0 \
-DBOOST_INCLUDE_DIR:PATH=C:/osvr/boost_1_60_0 \
-DBUILD_HEADER_DEPENDENCY_TESTS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF