From a684d1a32b424e02ec33ceabc5cb78db136d25d2 Mon Sep 17 00:00:00 2001 From: DreamNik Date: Tue, 3 Sep 2024 18:36:50 +0300 Subject: [PATCH] Fix SopaySDR library search when system cmake package present --- devices/soapysdr/CMakeLists.txt | 5 +++++ plugins/samplesink/soapysdroutput/CMakeLists.txt | 5 +++++ plugins/samplesource/soapysdrinput/CMakeLists.txt | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/devices/soapysdr/CMakeLists.txt b/devices/soapysdr/CMakeLists.txt index f9e1bbced..3c8bfe948 100644 --- a/devices/soapysdr/CMakeLists.txt +++ b/devices/soapysdr/CMakeLists.txt @@ -27,9 +27,14 @@ set_target_properties(soapysdrdevice target_link_libraries(soapysdrdevice ${SOAPYSDR_LINK_LIBRARIES} + ${SOAPYSDR_LIBRARIES} sdrbase ) +target_link_directories(soapysdrdevice PRIVATE + ${SOAPYSDR_LIBRARY_DIRS} +) + if(SOAPYSDR_EXTERNAL AND NOT LINUX) add_dependencies(soapysdrdevice soapysdr) endif() diff --git a/plugins/samplesink/soapysdroutput/CMakeLists.txt b/plugins/samplesink/soapysdroutput/CMakeLists.txt index 030adfee4..7a9f0b49d 100644 --- a/plugins/samplesink/soapysdroutput/CMakeLists.txt +++ b/plugins/samplesink/soapysdroutput/CMakeLists.txt @@ -56,9 +56,14 @@ target_link_libraries(${TARGET_NAME} ${TARGET_LIB_GUI} swagger ${SOAPYSDR_LINK_LIBRARIES} + ${SOAPYSDR_LIBRARIES} soapysdrdevice ) +target_link_directories(${TARGET_NAME} PRIVATE + ${SOAPYSDR_LIBRARY_DIRS} +) + install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) # Install debug symbols diff --git a/plugins/samplesource/soapysdrinput/CMakeLists.txt b/plugins/samplesource/soapysdrinput/CMakeLists.txt index adbe5262d..5fff69a7b 100644 --- a/plugins/samplesource/soapysdrinput/CMakeLists.txt +++ b/plugins/samplesource/soapysdrinput/CMakeLists.txt @@ -56,9 +56,14 @@ target_link_libraries(${TARGET_NAME} ${TARGET_LIB_GUI} swagger ${SOAPYSDR_LINK_LIBRARIES} + ${SOAPYSDR_LIBRARIES} soapysdrdevice ) +target_link_directories(${TARGET_NAME} PRIVATE + ${SOAPYSDR_LIBRARY_DIRS} +) + install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) # Install debug symbols