File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ endif()
313
313
# libusb
314
314
option (WITH_LIBUSB "Build USB RGBD-Camera drivers" TRUE )
315
315
if (WITH_LIBUSB )
316
- find_package ( libusb )
316
+ include ( " ${PCL_SOURCE_DIR} /cmake/pcl_find_libusb.cmake" )
317
317
endif ()
318
318
319
319
# Dependencies for different grabbers
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ find_package_handle_standard_args(libusb DEFAULT_MSG libusb_LIBRARIES libusb_INC
66
66
67
67
mark_as_advanced (libusb_INCLUDE_DIRS libusb_LIBRARIES )
68
68
69
- if (LIBUSB_FOUND )
69
+ if (libusb_FOUND )
70
70
add_library (libusb::libusb UNKNOWN IMPORTED )
71
71
set_target_properties (libusb::libusb PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${libusb_INCLUDE_DIR} " )
72
72
set_target_properties (libusb::libusb PROPERTIES IMPORTED_LOCATION "${libusb_LIBRARIES} " )
Original file line number Diff line number Diff line change
1
+ #
2
+ #pcl_find_libusb is used due to VCPKG making impossible to use local findXX modules.
3
+ # and VCPKG findlibusb doesn't create the libusb targets.
4
+
5
+ # Find and set libusb
6
+ find_package (libusb )
7
+
8
+ if (TARGET libusb::libusb )
9
+ #libusb target is found by the find_package script.
10
+ #VCPKG skip PCLs findlibusb and sets its own variables which is handled below.
11
+ return ()
12
+ endif ()
13
+
14
+ #Handle VCPKG definitions
15
+ include (FindPackageHandleStandardArgs )
16
+ find_package_handle_standard_args (libusb DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIRS )
17
+
18
+ mark_as_advanced (LIBUSB_INCLUDE_DIRS LIBUSB_LIBRARIES )
19
+
20
+ if (libusb_FOUND )
21
+ add_library (libusb::libusb UNKNOWN IMPORTED )
22
+ if (${LIBUSB_INCLUDE_DIRS} )
23
+ set_target_properties (libusb::libusb PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBUSB_INCLUDE_DIRS} " )
24
+ endif ()
25
+ if (EXISTS "${LIBUSB_LIBRARY} " )
26
+ set_target_properties (libusb::libusb PROPERTIES IMPORTED_LOCATION ${LIBUSB_LIBRARY} )
27
+ endif ()
28
+ if (EXISTS "${LIBUSB_LIBRARY_DEBUG} " )
29
+ set_target_properties (libusb::libusb PROPERTIES IMPORTED_LOCATION_DEBUG ${LIBUSB_LIBRARY_DEBUG} )
30
+ endif ()
31
+ if (EXISTS "${LIBUSB_LIBRARY_RELEASE} " )
32
+ set_target_properties (libusb::libusb PROPERTIES IMPORTED_LOCATION_RELEASE ${LIBUSB_LIBRARY_RELEASE} )
33
+ endif ()
34
+ endif ()
You can’t perform that action at this time.
0 commit comments