From 563a4d589fc00089279df088f1c617e599d4379c Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 29 Jun 2019 04:02:19 +0200 Subject: [PATCH] Build: Windows: fixed RTL-SDR support --- CHANGELOG | 6 ++++++ CMakeLists.txt | 2 +- debian/changelog | 6 ++++++ external/CMakeLists.txt | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 874e96027..16640044b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +sdrangel (4.10.3-1) unstable; urgency=medium + + * Windows build: fixed RTL-SDR support + + -- Edouard Griffiths, F4EXB Fri, 28 Jun 2019 20:44:06 +0200 + sdrangel (4.10.2-1) unstable; urgency=medium * Windows MSVC with cmake build introduction diff --git a/CMakeLists.txt b/CMakeLists.txt index c85425aad..edfc9eca7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(CMAKE_CXX_EXTENSIONS OFF) # configure version set(sdrangel_VERSION_MAJOR "4") set(sdrangel_VERSION_MINOR "10") -set(sdrangel_VERSION_PATCH "2") +set(sdrangel_VERSION_PATCH "3") set(sdrangel_VERSION_SUFFIX "") # SDRAngel cmake options diff --git a/debian/changelog b/debian/changelog index 874e96027..16640044b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +sdrangel (4.10.3-1) unstable; urgency=medium + + * Windows build: fixed RTL-SDR support + + -- Edouard Griffiths, F4EXB Fri, 28 Jun 2019 20:44:06 +0200 + sdrangel (4.10.2-1) unstable; urgency=medium * Windows MSVC with cmake build introduction diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 713701cc6..20cd56b98 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -372,6 +372,41 @@ if (LINUX) endif(LINUX) if(WIN32 OR APPLE) + if(ENABLE_RTLSDR) + if(WIN32) + set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}/libusb-1.0") + else() + set(RTLSDR_LIBUSB_INCLUDE "${LIBUSB_INCLUDE_DIR}") + endif() + # needs pkgconfig and libusb + ExternalProject_Add(rtlsdr + GIT_REPOSITORY https://github.com/osmocom/rtl-sdr.git + GIT_TAG ${RTLSDR_TAG} + DEPENDS ${PTHREADS4W_DEPENDS} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/rtlsdr" + CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORIES} + -DINSTALL_UDEV_RULES=${RTLSDR_UDEV} + -DLIBUSB_LIBRARIES=${LIBUSB_LIBRARIES} + -DLIBUSB_INCLUDE_DIR=${RTLSDR_LIBUSB_INCLUDE} + -DTHREADS_PTHREADS_INCLUDE_DIR=${PTHREADS4W_INCLUDE_DIR} + -DTHREADS_PTHREADS_WIN32_LIBRARY=${PTHREADS4W_LIBRARIES} + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + ExternalProject_Get_Property(rtlsdr source_dir binary_dir) + set(LIBRTLSDR_FOUND ON CACHE INTERNAL "") + set(LIBRTLSDR_INCLUDE_DIR "${source_dir}/include" CACHE INTERNAL "") + if(WIN32) + set(LIBRTLSDR_LIBRARIES "${SDRANGEL_BINARY_LIB_DIR}/rtlsdr.lib" CACHE INTERNAL "") + install(FILES "${SDRANGEL_BINARY_BIN_DIR}/rtlsdr${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION "${INSTALL_LIB_DIR}") + elseif(APPLE) + set(LIBRTLSDR_LIBRARIES "${binary_dir}/src/librtlsdr${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") + install(DIRECTORY "${binary_dir}/src/" DESTINATION "${INSTALL_LIB_DIR}" + FILES_MATCHING PATTERN "librtlsdr*${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(MACOS_EXTERNAL_LIBS_FIXUP "${MACOS_EXTERNAL_LIBS_FIXUP};${binary_dir}/src/") + endif() + endif(ENABLE_RTLSDR) + if(ENABLE_LIMESUITE) # needs pkgconfig, libusb ExternalProject_Add(limesuite