forked from ros-drivers/openni2_camera
-
Notifications
You must be signed in to change notification settings - Fork 3
/
FindOpenNI2.cmake
54 lines (42 loc) · 2.46 KB
/
FindOpenNI2.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
###############################################################################
# Find OpenNI2
#
# This sets the following variables:
# OPENNI2_FOUND - True if OPENNI2 was found.
# OPENNI2_INCLUDE_DIRS - Directories containing the OPENNI2 include files.
# OPENNI2_LIBRARIES - Libraries needed to use OPENNI.
###############################################################################
# Dependencies
set(OPENNI2_INCLUDE_PATH PATHS /usr/include/OpenNI-2 NO_DEFAULT_PATH)
set(OPENNI2_LIBRARY_PATH PATHS /usr/lib NO_DEFAULT_PATH)
set(OPENNI2_DRIVER_LIBRARY_PATH PATHS /usr/lib/OpenNI2/Drivers NO_DEFAULT_PATH)
#Find headers
find_path(OPENNI2_ROOT_INCLUDE_DIR NAMES OpenNI.h ${OPENNI2_INCLUDE_PATH})
find_path(OPENNI2_DRIVER_INCLUDE_DIR NAMES Driver/OniDriverAPI.h ${OPENNI2_INCLUDE_PATH})
find_path(OPENNI2_LINUX_INCLUDE_DIR NAMES Linux-x86/OniPlatformLinux-x86.h ${OPENNI2_INCLUDE_PATH})
#main libraries:
find_library(OPENNI2_MAIN_LIBRARY NAMES OpenNI2 ${OPENNI2_LIBRARY_PATH})
mark_as_advanced(OPENNI2_MAIN_LIBRARY)
find_library(OPENNI2_ONIFILE_LIBRARY NAMES OniFile ${OPENNI2_DRIVER_LIBRARY_PATH})
mark_as_advanced(OPENNI2_ONIFILE_LIBRARY)
find_library(OPENNI2_PS1080_LIBRARY NAMES PS1080 ${OPENNI2_DRIVER_LIBRARY_PATH})
mark_as_advanced(OPENNI2_PS1080_LIBRARY)
# Output variables generation
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPENNI2 DEFAULT_MSG OPENNI2_MAIN_LIBRARY
OPENNI2_ONIFILE_LIBRARY
OPENNI2_PS1080_LIBRARY
OPENNI2_ROOT_INCLUDE_DIR
OPENNI2_DRIVER_INCLUDE_DIR
OPENNI2_LINUX_INCLUDE_DIR)
if(OPENNI2_FOUND)
set(OPENNI2_INCLUDE_DIRS ${OPENNI2_ROOT_INCLUDE_DIR}
${OPENNI2_DRIVER_INCLUDE_DIR}
${OPENNI2_LINUX_INCLUDE_DIR})
set(OPENNI2_LIBRARIES ${OPENNI2_MAIN_LIBRARY}
${OPENNI2_ONIFILE_LIBRARY}
${OPENNI2_PS1080_LIBRARY})
endif(OPENNI2_FOUND)
#message("=> ***** OPENNI2_FOUND = ${OPENNI2_FOUND}")
#message("=> ***** OPENNI2_INCLUDE_DIRS = ${OPENNI2_INCLUDE_DIRS}")
#message("=> ***** OPENNI2_LIBRARIES = ${OPENNI2_LIBRARIES}")