Hi all, on some systems building librtlsdr can fail when libusb-1.0 is not installed in the standard library locations (e.g. macOS with libusb installed via homebrew can have the shared library in /usr/local/Cellar/libusb/1.0.24/lib).
The below patch includes LIBUSB_LIBRARY_DIRS in the search path for the linker to correct this issue.
For your kind consideration. Thanks, Jasper
Author: jvde.github jvde.github@gmail.com Date: Mon Jan 24 19:21:44 2022 +0100
fix build for macOS
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7b47309..3b8060b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(rtlsdr SHARED librtlsdr.c tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c) target_link_libraries(rtlsdr ${LIBUSB_LIBRARIES} ${THREADS_PTHREADS_LIBRARY}) +target_link_directories(rtlsdr PUBLIC ${LIBUSB_LIBRARY_DIRS}) target_include_directories(rtlsdr PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include> $<INSTALL_INTERFACE:include> # <prefix>/include