File dso-build-against-systemwide-libsdr.patch of Package dso
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f60216..49be2d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,9 @@ IF(NOT LIBSDR_FOUND)
SET(SDR_WITH_PORTAUDIO ON)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libsdr/src/config.hh.in
${CMAKE_CURRENT_BINARY_DIR}/libsdr/src/config.hh)
+ELSE(NOT LIBSDR_FOUND)
+ INCLUDE_DIRECTORIES(${LIBSDR_INCLUDE_DIRS})
+ SET(LIBS ${LIBS} ${LIBSDR_LIBRARIES})
ENDIF(NOT LIBSDR_FOUND)
# Get default directories under Linux
@@ -52,7 +55,7 @@ ELSE()
ENDIF(UNIX AND NOT APPLE)
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/src)
-set(LIBS ${FFTW_LIBRARIES} ${FFTWSingle_LIBRARIES} ${PORTAUDIO_LIBRARIES} ${THREAD_LIBS})
+set(LIBS ${LIBS} ${FFTW_LIBRARIES} ${FFTWSingle_LIBRARIES} ${PORTAUDIO_LIBRARIES} ${THREAD_LIBS})
# Set compiler flags
diff --git a/cmake/FindLibsdr.cmake b/cmake/FindLibsdr.cmake
index a8b88f7..2a44a57 100644
--- a/cmake/FindLibsdr.cmake
+++ b/cmake/FindLibsdr.cmake
@@ -4,17 +4,19 @@
# LIBSDR_LIBRARIES - List of libraries when using libsdr.
# LIBSDR_FOUND - True if libsdr found.
-if (LIBSDR_INCLUDE_DIRS)
+if(LIBSDR_INCLUDE_DIRS)
# Already in cache, be silent
- set (LIBSDR_FIND_QUIETLY TRUE)
-endif (LIBSDR_INCLUDE_DIRS)
+ set(LIBSDR_FIND_QUIETLY TRUE)
+endif(LIBSDR_INCLUDE_DIRS)
-find_path (LIBSDR_INCLUDE_DIRS sdr.h PREFIX "libsdr/")
-find_library (LIBSDR_LIBRARIES NAMES sdr)
+find_path(LIBSDR_INCLUDE_DIRS sdr.hh PATH_SUFFIXES libsdr)
+find_library(LIBSDR_LIBRARY NAMES sdr)
+
+set(LIBSDR_LIBRARIES ${LIBSDR_LIBRARY})
# handle the QUIETLY and REQUIRED arguments and set LIBSDR_FOUND to TRUE if
# all listed variables are TRUE
-include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Libsdr DEFAULT_MSG LIBSDR_LIBRARIES LIBSDR_INCLUDE_DIRS)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Libsdr DEFAULT_MSG LIBSDR_LIBRARIES LIBSDR_INCLUDE_DIRS)
-mark_as_advanced (LIBSDR_LIBRARIES LIBSDR_INCLUDE_DIRS)
+mark_as_advanced(LIBSDR_LIBRARIES LIBSDR_INCLUDE_DIRS)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7f3ce51..55257fd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,7 +27,11 @@ QT5_ADD_RESOURCES(sdr_dso_RESOURCES_RCC ${sdr_dso_RESOURCES})
add_executable(dso WIN32 MACOSX_BUNDLE ${sdr_dso_SOURCES} ${sdr_dso_MOC_SOURCES}
${sdr_dso_RESOURCES_RCC})
+IF(NOT LIBSDR_FOUND)
target_link_libraries(dso ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${LIBS} libsdr)
+ELSE(NOT LIBSDR_FOUND)
+target_link_libraries(dso ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${LIBS} )
+ENDIF(NOT LIBSDR_FOUND)
IF(WIN32 OR WIN64)
install(TARGETS dso RUNTIME DESTINATION bin)