summaryrefslogtreecommitdiffhomepage
path: root/tracker-hydra/CMakeLists.txt
blob: b99c1d7a3d184538b936b9f68e2c2595bc901d1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
set(SDK_HYDRA "" CACHE PATH "libSixense path for Razer Hydra")
if(SDK_HYDRA AND opentrack-intel)
    otr_module(tracker-hydra)
    target_include_directories(opentrack-tracker-hydra SYSTEM PUBLIC ${SDK_HYDRA}/include ${SDK_HYDRA}/include/sixense_utils)
    if(opentrack-64bit)
        set(six4 _x64)
    else()
        set(six4 "")
    endif()
    if(WIN32)
        if(MSVC)
            set(dir lib)
            set(ext lib)
        else()
            set(dir bin)
            set(ext dll)
        endif()
        if (opentrack-64bit)
            set(part "x64")
        else()
            set(part "win32")
        endif()
        set(lib "${SDK_HYDRA}/${dir}/${part}/release_dll/sixense${six4}.${ext}")
        set(dll "${SDK_HYDRA}/bin/${part}/release_dll/sixense${six4}.dll")
        install(FILES "${dll}" DESTINATION ${opentrack-hier-pfx} PERMISSIONS ${opentrack-perms-exec})
        target_link_libraries(opentrack-tracker-hydra "${lib}")
    else()
        if(APPLE)
            set(dest ".")
            set(part "release_dll")
            set(soext "dylib")
            set(plat "osx")
        else() # assume Linux
            set(dest "${opentrack-hier-pfx}")
            set(part "release")
            set(soext "so")
            set(plat "linux")
        endif()
        set(lib "libsixense${six4}.${soext}")
        target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/${plat}${six4}/${part}/${lib}")
        install(FILES "${SDK_HYDRA}/lib/${plat}${six4}/${part}/${lib}" DESTINATION ${opentrack-hier-pfx} PERMISSIONS ${opentrack-perms-exec})
    endif()
endif()