forked from vircadia/vircadia-native-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindKinect.cmake
59 lines (46 loc) · 1.59 KB
/
FindKinect.cmake
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# FindKinect.cmake
#
# Try to find the Perception Kinect SDK
#
# You must provide a KINECT_ROOT_DIR which contains lib and include directories
#
# Once done this will define
#
# KINECT_FOUND - system found Kinect SDK
# KINECT_INCLUDE_DIRS - the Kinect SDK include directory
# KINECT_LIBRARIES - Link this to use Kinect
#
# Created by Brad Hefta-Gaub on 2016/12/7
# Copyright 2016 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
hifi_library_search_hints("kinect")
find_path(KINECT_INCLUDE_DIRS Kinect.h PATH_SUFFIXES inc HINTS $ENV{KINECT_ROOT_DIR} $ENV{KINECTSDK20_DIR})
if (WIN32)
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(ARCH_DIR "x64")
else()
set(ARCH_DIR "x86")
endif()
find_library(
KINECT_LIBRARY_RELEASE Kinect20
PATH_SUFFIXES "Lib/${ARCH_DIR}" "lib"
HINTS ${KINECT_SEARCH_DIRS}
PATHS $ENV{KINECT_ROOT_DIR} $ENV{KINECTSDK20_DIR})
set(KINECT_LIBRARIES ${KINECT_LIBRARY})
# DLL not needed yet??
#find_path(KINECT_DLL_PATH Kinect20.Face.dll PATH_SUFFIXES "bin" HINTS ${KINECT_SEARCH_DIRS})
endif ()
include(SelectLibraryConfigurations)
select_library_configurations(KINECT)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(KINECT DEFAULT_MSG KINECT_INCLUDE_DIRS KINECT_LIBRARY)
# DLLs not needed yet
#if (WIN32)
# add_paths_to_fixup_libs(${KINECT_DLL_PATH})
#endif ()
mark_as_advanced(KINECT_INCLUDE_DIRS KINECT_LIBRARIES KINECT_SEARCH_DIRS)