From 70d155048fb81763b8df70de7e71517d23b886e9 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 27 Jul 2015 14:43:32 -0700 Subject: [PATCH] Add SMI iViewHMD eye tracking as an optional library --- cmake/modules/FindiViewHMD.cmake | 27 ++++++++++++++++++++++++++ interface/CMakeLists.txt | 2 +- interface/external/iViewHMD/readme.txt | 14 +++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/FindiViewHMD.cmake create mode 100644 interface/external/iViewHMD/readme.txt diff --git a/cmake/modules/FindiViewHMD.cmake b/cmake/modules/FindiViewHMD.cmake new file mode 100644 index 0000000000..eb107a2833 --- /dev/null +++ b/cmake/modules/FindiViewHMD.cmake @@ -0,0 +1,27 @@ +# +# FindiViewHMD.cmake +# +# Try to find the SMI iViewHMD eye tracker library +# +# You must provide a IVIEWHMD_ROOT_DIR which contains lib and include directories +# +# Once done this will define +# +# IVIEWHMD_FOUND - system found iViewHMD +# IVIEWHMD_INCLUDE_DIRS - the iViewHMD include directory +# IVIEWHMD_LIBRARIES - link this to use iViewHMD +# +# Created on 27 Jul 2015 by David Rowe +# Copyright 2015 High Fidelity, Inc. +# + +include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") +hifi_library_search_hints("iViewHMD") + +find_path(IVIEWHMD_INCLUDE_DIRS iViewHMDAPI.h PATH_SUFFIXES include HINTS ${IVIEWHMD_SEARCH_DIRS}) +find_library(IVIEWHMD_LIBRARIES NAMES iViewHMDAPI PATH_SUFFIXES lib HINTS ${IVIEWHMD_SEARCH_DIRS}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(iViewHMD DEFAULT_MSG IVIEWHMD_INCLUDE_DIRS IVIEWHMD_LIBRARIES) + +mark_as_advanced(IVIEWHMD_INCLUDE_DIRS IVIEWHMD_LIBRARIES IVIEWHMD_SEARCH_DIRS) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 0c44ac801f..46a83ea707 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -2,7 +2,7 @@ set(TARGET_NAME interface) project(${TARGET_NAME}) # set a default root dir for each of our optional externals if it was not passed -set(OPTIONAL_EXTERNALS "Faceshift" "Sixense" "LeapMotion" "RtMidi" "SDL2" "RSSDK") +set(OPTIONAL_EXTERNALS "Faceshift" "Sixense" "LeapMotion" "RtMidi" "SDL2" "RSSDK" "iViewHMD") foreach(EXTERNAL ${OPTIONAL_EXTERNALS}) string(TOUPPER ${EXTERNAL} ${EXTERNAL}_UPPERCASE) if (NOT ${${EXTERNAL}_UPPERCASE}_ROOT_DIR) diff --git a/interface/external/iViewHMD/readme.txt b/interface/external/iViewHMD/readme.txt new file mode 100644 index 0000000000..7e0af7e23e --- /dev/null +++ b/interface/external/iViewHMD/readme.txt @@ -0,0 +1,14 @@ + +Instructions for adding SMI HMD Eye Tracking to Interface on Windows +David Rowe, 27 Jul 2015. + +1. Download and install the SMI HMD Eye Tracking software from http://update.smivision.com/iViewNG-HMD.exe. + +2. Copy the SDK folders (3rdParty, include, lib) from the SDK installation folder C:\Program Files (x86)\SMI\iViewNG-HMD\SDK + into the interface/externals/iViewHMD folder. This readme.txt should be there as well. + + You may optionally choose to copy the SDK folders to a location outside the repository (so you can re-use with different + checkouts and different projects). If so, set the ENV variable "HIFI_LIB_DIR" to a directory containing a subfolder + "iViewHMD" that contains the folders mentioned above. + +3. Clear your build directory, run cmake and build, and you should be all set.