From 821e3a4085132cfc45099bed09abc1fcd06f2256 Mon Sep 17 00:00:00 2001 From: Jeremy Cooper Date: Thu, 16 Nov 2023 13:58:51 -0800 Subject: [PATCH 1/2] When installing, consult SoapySDR for installation dir, not system dir. This fixes an issue when SoapySDR isn't installed in a "default" system directory (/usr/local) but is instead part of a larger package system (like HomeBrew), and thus, installed in an alternate location. With this fix, the SoapyUHD plugin file should end up in the proper library directory no matter how or where SoapySDR was installed. --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31b3d28..fd6db84 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,11 @@ message(STATUS "UHD root directory: ${UHD_ROOT}") message(STATUS "UHD include directories: ${UHD_INCLUDE_DIRS}") message(STATUS "UHD libraries: ${UHD_LIBRARIES}") +if (NOT SOAPY_ROOT) + get_filename_component(SOAPYSDR_ROOT "${SoapySDR_INCLUDE_DIRS}/.." ABSOLUTE) +endif() +message(STATUS "SoapySDR root directory: ${SOAPYSDR_ROOT}") + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${SoapySDR_INCLUDE_DIRS}) include_directories(${UHD_INCLUDE_DIRS}) @@ -166,6 +171,8 @@ install(TARGETS soapySupport DESTINATION ${UHD_ROOT}/lib${LIB_SUFFIX}/uhd/modules ) +set(CMAKE_INSTALL_PREFIX ${SOAPYSDR_ROOT}) + ######################################################################## # rpath setup - http://www.cmake.org/Wiki/CMake_RPATH_handling ######################################################################## From 80a672f3a85927c8399dcdd53b762ce60acc9c18 Mon Sep 17 00:00:00 2001 From: Jeremy Cooper Date: Thu, 16 Nov 2023 14:35:34 -0800 Subject: [PATCH 2/2] Test and set the same variable, not a different one. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd6db84..625489c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,7 @@ message(STATUS "UHD root directory: ${UHD_ROOT}") message(STATUS "UHD include directories: ${UHD_INCLUDE_DIRS}") message(STATUS "UHD libraries: ${UHD_LIBRARIES}") -if (NOT SOAPY_ROOT) +if (NOT SOAPYSDR_ROOT) get_filename_component(SOAPYSDR_ROOT "${SoapySDR_INCLUDE_DIRS}/.." ABSOLUTE) endif() message(STATUS "SoapySDR root directory: ${SOAPYSDR_ROOT}")