-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from kwaegel/openni2_pullrequest
OpenNI 2 grabber
- Loading branch information
Showing
41 changed files
with
6,466 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
############################################################################### | ||
# Find OpenNI 2 | ||
# | ||
# This sets the following variables: | ||
# OPENNI2_FOUND - True if OPENNI 2 was found. | ||
# OPENNI2_INCLUDE_DIRS - Directories containing the OPENNI 2 include files. | ||
# OPENNI2_LIBRARIES - Libraries needed to use OPENNI 2. | ||
# OPENNI2_DEFINITIONS - Compiler flags for OPENNI 2. | ||
# | ||
# For libusb-1.0, add USB_10_ROOT if not found | ||
|
||
find_package(PkgConfig QUIET) | ||
|
||
# Find LibUSB | ||
if(NOT WIN32) | ||
pkg_check_modules(PC_USB_10 libusb-1.0) | ||
find_path(USB_10_INCLUDE_DIR libusb-1.0/libusb.h | ||
HINTS ${PC_USB_10_INCLUDEDIR} ${PC_USB_10_INCLUDE_DIRS} "${USB_10_ROOT}" "$ENV{USB_10_ROOT}" | ||
PATH_SUFFIXES libusb-1.0) | ||
|
||
find_library(USB_10_LIBRARY | ||
NAMES usb-1.0 | ||
HINTS ${PC_USB_10_LIBDIR} ${PC_USB_10_LIBRARY_DIRS} "${USB_10_ROOT}" "$ENV{USB_10_ROOT}" | ||
PATH_SUFFIXES lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(USB_10 DEFAULT_MSG USB_10_LIBRARY USB_10_INCLUDE_DIR) | ||
|
||
if(NOT USB_10_FOUND) | ||
message(STATUS "OpenNI 2 disabled because libusb-1.0 not found.") | ||
return() | ||
else() | ||
include_directories(SYSTEM ${USB_10_INCLUDE_DIR}) | ||
endif() | ||
endif(NOT WIN32) | ||
|
||
if(${CMAKE_VERSION} VERSION_LESS 2.8.2) | ||
pkg_check_modules(PC_OPENNI2 openni2-dev) | ||
else() | ||
pkg_check_modules(PC_OPENNI2 QUIET openni2-dev) | ||
endif() | ||
|
||
set(OPENNI2_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER}) | ||
|
||
set(OPENNI2_SUFFIX) | ||
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(OPENNI2_SUFFIX 64) | ||
endif(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
|
||
find_path(OPENNI2_INCLUDE_DIRS OpenNI.h | ||
PATHS | ||
"$ENV{OPENNI2_INCLUDE${OPENNI2_SUFFIX}}" # Win64 needs '64' suffix | ||
/usr/include/openni2 # common path for deb packages | ||
) | ||
|
||
find_library(OPENNI2_LIBRARY | ||
NAMES OpenNI2 # No suffix needed on Win64 | ||
libOpenNI2 # Linux | ||
PATHS "$ENV{OPENNI2_LIB${OPENNI2_SUFFIX}}" # Windows default path, Win64 needs '64' suffix | ||
"$ENV{OPENNI2_REDIST}" # Linux install does not use a separate 'lib' directory | ||
) | ||
|
||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") | ||
set(OPENNI2_LIBRARIES ${OPENNI2_LIBRARY} ${LIBUSB_1_LIBRARIES}) | ||
else() | ||
set(OPENNI2_LIBRARIES ${OPENNI2_LIBRARY}) | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(OpenNI2 DEFAULT_MSG OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS) | ||
|
||
mark_as_advanced(OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS) | ||
|
||
if(OPENNI2_FOUND) | ||
# Add the include directories | ||
set(OPENNI2_INCLUDE_DIRS ${OPENNI2_INCLUDE_DIR}) | ||
set(OPENNI2_REDIST_DIR $ENV{OPENNI2_REDIST${OPENNI2_SUFFIX}}) | ||
message(STATUS "OpenNI 2 found (include: ${OPENNI2_INCLUDE_DIRS}, lib: ${OPENNI2_LIBRARY}, redist: ${OPENNI2_REDIST_DIR})") | ||
endif(OPENNI2_FOUND) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ endif(${CMAKE_VERSION} VERSION_LESS 2.8.5) | |
set(Boost_NO_BOOST_CMAKE ON) | ||
|
||
# Optional boost modules | ||
find_package(Boost 1.40.0 QUIET COMPONENTS serialization mpi) | ||
find_package(Boost 1.47.0 QUIET COMPONENTS serialization mpi) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
kwaegel
via email
|
||
if(Boost_MPI_FOUND) | ||
set(BOOST_MPI_FOUND TRUE) | ||
endif(Boost_MPI_FOUND) | ||
|
@@ -32,15 +32,9 @@ if(Boost_SERIALIZATION_FOUND) | |
endif(Boost_SERIALIZATION_FOUND) | ||
|
||
# Required boost modules | ||
set(BOOST_REQUIRED_MODULES system filesystem thread date_time iostreams) | ||
# Starting with Boost 1.50, boost_thread depends on chrono. As this is not | ||
# taken care of automatically on Windows, we add an explicit dependency as a | ||
# workaround. | ||
if(WIN32 AND Boost_VERSION VERSION_GREATER "104900") | ||
set(BOOST_REQUIRED_MODULES ${BOOST_REQUIRED_MODULES} chrono) | ||
endif(WIN32 AND Boost_VERSION VERSION_GREATER "104900") | ||
set(BOOST_REQUIRED_MODULES system filesystem thread date_time iostreams chrono) | ||
|
||
find_package(Boost 1.40.0 REQUIRED COMPONENTS ${BOOST_REQUIRED_MODULES}) | ||
find_package(Boost 1.47.0 REQUIRED COMPONENTS ${BOOST_REQUIRED_MODULES}) | ||
|
||
if(Boost_FOUND) | ||
set(BOOST_FOUND TRUE) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
@kwaegel why is it necessary to upgrade to 1.47 ?