2021-02-09 10:29:15 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-12-14 16:07:17 +08:00
|
|
|
index fbaffc9..451b689 100644
|
2021-02-09 10:29:15 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-12-14 16:07:17 +08:00
|
|
|
@@ -39,10 +39,11 @@ set(SOURCES
|
2021-02-09 10:29:15 +08:00
|
|
|
src/misc.c
|
|
|
|
)
|
|
|
|
|
|
|
|
-find_package(LibUSB)
|
2023-12-14 16:07:17 +08:00
|
|
|
+FIND_PACKAGE(PkgConfig REQUIRED)
|
|
|
|
+pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
|
2021-02-09 10:29:15 +08:00
|
|
|
|
|
|
|
# JpegPkg name to differ from shipped with CMake
|
2021-09-11 04:41:46 +08:00
|
|
|
-find_package(JpegPkg QUIET)
|
|
|
|
+find_package(JPEG REQUIRED)
|
|
|
|
if(JPEG_FOUND)
|
|
|
|
message(STATUS "Building libuvc with JPEG support.")
|
|
|
|
set(LIBUVC_HAS_JPEG TRUE)
|
2023-12-14 16:07:17 +08:00
|
|
|
@@ -116,7 +117,7 @@ foreach(target_name IN LISTS UVC_TARGETS)
|
2021-02-09 10:29:15 +08:00
|
|
|
)
|
|
|
|
target_link_libraries(${target_name}
|
|
|
|
# libusb-1.0 used internally so we link to it privately.
|
2023-12-14 16:07:17 +08:00
|
|
|
- PRIVATE LibUSB::LibUSB ${threads}
|
|
|
|
+ PRIVATE PkgConfig::libusb ${threads}
|
2021-02-09 10:29:15 +08:00
|
|
|
)
|
|
|
|
if(JPEG_FOUND)
|
|
|
|
target_link_libraries(${target_name}
|
2021-09-11 04:41:46 +08:00
|
|
|
diff --git a/libuvcConfig.cmake b/libuvcConfig.cmake
|
2023-12-14 16:07:17 +08:00
|
|
|
index b9887ea..c704ab5 100644
|
2021-09-11 04:41:46 +08:00
|
|
|
--- a/libuvcConfig.cmake
|
|
|
|
+++ b/libuvcConfig.cmake
|
2023-12-14 16:07:17 +08:00
|
|
|
@@ -10,8 +10,11 @@ if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
|
2021-09-11 04:41:46 +08:00
|
|
|
list(APPEND extraArgs REQUIRED)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
-find_package(JpegPkg ${extraArgs})
|
|
|
|
-find_package(LibUSB ${extraArgs})
|
|
|
|
+include(CMakeFindDependencyMacro)
|
|
|
|
+find_dependency(JPEG ${extraArgs})
|
2023-12-14 16:07:17 +08:00
|
|
|
+find_dependency(Threads)
|
|
|
|
+find_package(PkgConfig REQUIRED)
|
|
|
|
+pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
|
2021-09-11 04:41:46 +08:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/libuvcTargets.cmake")
|
|
|
|
|
|
|
|
set(libuvc_FOUND TRUE)
|