-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RSSDK 2.0 (librealsense2) grabber #2214
Changes from 1 commit
22ef192
3c4ac27
f3b47cf
f5ced03
dfa2b7c
b8513c4
85974ad
3c4c73c
7df5e65
56754ee
2d3bdc6
0179fba
2f7b7a2
bc7e82e
2c42a0c
7be6219
4cf198d
8575522
f147759
4709f1f
9e09119
3f25e56
313e5f5
792ff4d
5e780b2
d294aff
5bc175b
8cf1d7e
6b88599
1bd2270
9c6d641
1831099
3f7a587
ebc9067
b8ffae8
75cf960
1a5db1f
bddc3bb
43756c3
d8a8923
c42a013
4be44f1
1528a3d
ed9e09f
312bc25
69ba109
65fc64d
131775c
b5a5e9c
36d3653
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…_path and find_library
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,13 +12,43 @@ | |
find_package(PkgConfig QUIET) | ||
|
||
# Include directories | ||
find_path(LIBREALSENSE_INCLUDE_DIR librealsense2/rs.h) | ||
find_path(LIBREALSENSE_INCLUDE_DIR librealsense2/rs.h | ||
PATHS "$ENV{realsense2_DIR}" | ||
"$ENV{PROGRAMW6432}/librealsense2" # for self built library | ||
"$ENV{PROGRAMFILES}/librealsense2" # for self built library | ||
"$ENV{PROGRAMFILES}/Intel RealSense SDK 2.0" # for pre built library | ||
# "Please specify search paths for Linux and MacOS" | ||
PATH_SUFFIXES include) | ||
|
||
set(LIBREALSENSE_INCLUDE_DIRS ${LIBREALSENSE_INCLUDE_DIR}) | ||
mark_as_advanced(LIBREALSENSE_INCLUDE_DIRS) | ||
|
||
# Libraries | ||
find_library(LIBREALSENSE_LIBRARY NAMES librealsense.lib) | ||
find_library(LIBREALSENSE_LIBRARY_DEBUG NAMES librealsense.lib) | ||
set(LIBREALSENSE_RELEASE_NAME realsense2) | ||
set(LIBREALSENSE_DEBUG_NAME realsense2_d) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course, you are right about the name of the libraries (librealsense.lib vs realsense2) 👍 I also liked your recommended update to include PATHS and PATH_SUFFIXES in the calls to find_path and find_library, so I've updated that as well. I don't know what appropriate values would be on linux/mac either -- hopefully a Linux/Mac user can comment with additional recommendations for those platforms |
||
|
||
set(LIBREALSENSE_SUFFIX x86) | ||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
set(LIBREALSENSE_SUFFIX x64) | ||
endif() | ||
|
||
find_library(LIBREALSENSE_LIBRARY | ||
NAMES ${LIBREALSENSE_RELEASE_NAME} | ||
PATHS "$ENV{realsense2_DIR}" | ||
"$ENV{PROGRAMW6432}/librealsense2" | ||
"$ENV{PROGRAMFILES}/librealsense2" | ||
"$ENV{PROGRAMFILES}/Intel RealSense SDK 2.0" | ||
# "Please specify search paths for Linux and MacOS" | ||
PATH_SUFFIXES lib lib/${LIBREALSENSE_SUFFIX}) | ||
|
||
find_library(LIBREALSENSE_LIBRARY_DEBUG | ||
NAMES ${LIBREALSENSE_DEBUG_NAME} | ||
PATHS "$ENV{realsense2_DIR}" | ||
"$ENV{PROGRAMW6432}/librealsense2" | ||
"$ENV{PROGRAMFILES}/librealsense2" | ||
"$ENV{PROGRAMFILES}/Intel RealSense SDK 2.0" | ||
# "Please specify search paths for Linux and MacOS" | ||
PATH_SUFFIXES lib lib/${LIBREALSENSE_SUFFIX}) | ||
|
||
if(NOT LIBREALSENSE_LIBRARY_DEBUG) | ||
set(LIBREALSENSE_LIBRARY_DEBUG ${LIBREALSENSE_LIBRARY}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it add
"/usr/local/"
and"/usr/"
for Linux and MacOS?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable, and looking at libusb, these seem to be some of the standard hints on linux: https://github.com/PointCloudLibrary/pcl/blob/46cb8fe5589e88e36d79f9b8b8e5f4ff4fceb5de/cmake/Modules/Findlibusb-1.0.cmake
I'll do a quick review of the librealsense docs and see if they install to any of these paths by default on linux/mac