summaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-10-29 10:34:44 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-10-29 10:34:44 +0100
commit5049312cc8847f5bd8cc9cf32dd42e39ae0bb1f5 (patch)
tree983894ee8303c8d271182c6e52f0d4770cdf3ce2 /CMakeLists.txt
parentb0fbe9605b47437d06694a747e607a1b9558c8b3 (diff)
support rift 0.2.5, 0.4.2, 0.8.0
Issue: #263
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt84
1 files changed, 29 insertions, 55 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e447c4b8..a444bce3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,7 +186,8 @@ endif()
SET(SDK_HYDRA "" CACHE PATH "libSixense path for Razer Hydra")
SET(SDK_HYDRA_AMD64 FALSE CACHE BOOL "whether libSixense is amd64 (else ia-32)")
-SET(SDK_RIFT "" CACHE PATH "libOVR path for Oculus Rift")
+SET(SDK_RIFT_080 "" CACHE PATH "libOVR path for Oculus Rift")
+SET(SDK_RIFT_042 "" CACHE PATH "libOVR path for Oculus Rift")
SET(SDK_RIFT_025 "" CACHE PATH "libOVR 0.2.5 path for Oculus Rift")
set(SDK_ARUCO_LIBPATH "" CACHE FILEPATH "Aruco paper marker tracker static library path")
@@ -427,67 +428,40 @@ endif()
link_with_dinput8(opentrack-tracker-joystick)
-if(SDK_RIFT_025)
- set(link-flags)
- set(c-flags)
- if(APPLE)
- set(link-flags "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz")
- set(c-flags "-fno-strict-aliasing")
- else()
- if(NOT MSVC)
+foreach(ver 025 042 080)
+ if(SDK_RIFT_${ver})
+ set(link-flags)
+ set(c-flags)
+ if(APPLE)
+ set(link-flags "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz")
set(c-flags "-fno-strict-aliasing")
- endif()
- endif()
- opentrack_library(opentrack-tracker-rift-025 ftnoir_tracker_rift_025 LINK ${link-flags} COMPILE ${c-flags})
- target_include_directories(opentrack-tracker-rift-025 SYSTEM PUBLIC ${SDK_RIFT_025}/Include ${SDK_RIFT_025}/Src)
- if(WIN32)
- if(MSVC)
- set(ext lib)
- set(p)
else()
- set(ext a)
- set(p lib)
+ if(NOT MSVC)
+ set(c-flags "-fno-strict-aliasing")
endif()
- target_link_libraries(opentrack-tracker-rift-025 ${SDK_RIFT_025}/${p}LibOVR.${ext} winmm setupapi ws2_32 imagehlp wbemuuid)
- else()
- if(NOT APPLE)
- target_link_libraries(opentrack-tracker-rift-025 ${SDK_RIFT_025}/libLibOVR.a udev Xinerama)
- else()
- target_link_libraries(opentrack-tracker-rift-025 ${SDK_RIFT_025}/libLibOVR.a)
endif()
- endif()
-endif()
-
-if(SDK_RIFT)
- set(link-flags)
- set(c-flags)
- if(APPLE)
- set(link-flags "-framework CoreFoundation -framework CoreGraphics -framework IOKit -framework Quartz")
- set(c-flags "-fno-strict-aliasing")
- else()
- if(NOT MSVC)
- set(c-flags "-fno-strict-aliasing")
- endif()
- endif()
- opentrack_library(opentrack-tracker-rift ftnoir_tracker_rift LINK ${link-flags} COMPILE ${c-flags})
- target_include_directories(opentrack-tracker-rift SYSTEM PUBLIC ${SDK_RIFT}/Include ${SDK_RIFT}/Src)
- if(WIN32)
- if(MSVC)
- set(ext lib)
- set(p)
- else()
- set(ext a)
- set(p lib)
- endif()
- target_link_libraries(opentrack-tracker-rift ${SDK_RIFT}/${p}LibOVR.${ext} winmm setupapi ws2_32 imagehlp wbemuuid)
- else()
- if(NOT APPLE)
- target_link_libraries(opentrack-tracker-rift ${SDK_RIFT}/libLibOVR.a udev Xinerama)
+ opentrack_library(opentrack-tracker-rift-${ver} ftnoir_tracker_rift_${ver} LINK ${link-flags} COMPILE ${c-flags})
+ target_include_directories(opentrack-tracker-rift-${ver} SYSTEM PUBLIC
+ ${SDK_RIFT_${ver}}/Include ${SDK_RIFT_${ver}}/Src
+ )
+ if(WIN32)
+ if(MSVC)
+ set(ext lib)
+ set(p)
+ else()
+ set(ext a)
+ set(p lib)
+ endif()
+ target_link_libraries(opentrack-tracker-rift-${ver} ${SDK_RIFT_${ver}}/${p}LibOVR.${ext} winmm setupapi ws2_32 imagehlp wbemuuid)
else()
- target_link_libraries(opentrack-tracker-rift ${SDK_RIFT}/libLibOVR.a)
+ if(NOT APPLE)
+ target_link_libraries(opentrack-tracker-rift-${ver} ${SDK_RIFT_${ver}}/libLibOVR.a udev Xinerama)
+ else()
+ target_link_libraries(opentrack-tracker-rift-${ver} ${SDK_RIFT_${ver}}/libLibOVR.a)
+ endif()
endif()
endif()
-endif()
+endforeach()
if(SDK_HYDRA)
opentrack_library(opentrack-tracker-hydra ftnoir_tracker_hydra)