From 816e0e28e0e66fe2b3ceb8169eaa302bf229587a Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 3 Jun 2019 00:35:06 +0200 Subject: [PATCH] Build: Linux: added airspyhf external library --- external/CMakeLists.txt | 25 +++++++++++++------- plugins/samplesource/airspyhf/CMakeLists.txt | 4 ++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 0a0e250df..d2d4d296f 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -16,6 +16,7 @@ set(DSDCC_TAG 952fb5f5f7bf1928a290ad62acce35492df13f5d) set(LIMESUITE_TAG "v19.01.0") set(BLADERF_TAG 896d2431b3a35a4b31b6e729386202ebf5fdc5c0) set(LIBIIO_TAG 826563e41b5ce9890b75506f672017de8d76d52d) +set(AIRSPYHF_TAG "1.1.5") # For some external project macros @@ -228,6 +229,22 @@ if (LINUX) set(LIBIIO_FOUND ON CACHE INTERNAL "") set(LIBIIO_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/libiio/src/libiio" CACHE INTERNAL "") set(LIBIIO_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libiio.so" CACHE INTERNAL "") + + # apt install libairspyhf-dev (only on ubuntu 18.04) + # needs libusb and pkgconfig + ExternalProject_Add(airspyhf + GIT_REPOSITORY https://github.com/airspy/airspyhf.git + GIT_TAG ${AIRSPYHF_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspyhf" + CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORY} + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + ExternalProject_Get_Property(airspyhf source_dir) + set(LIBAIRSPYHF_FOUND ON CACHE INTERNAL "") + set(LIBAIRSPYHF_INCLUDE_DIR "${source_dir}/.." CACHE INTERNAL "") + set(LIBAIRSPYHF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libairspyhf.so" CACHE INTERNAL "") + makeLink("${source_dir}/libairspyhf/src" "${source_dir}/../libairspyhf" airspyhf) endif() # already on the respository @@ -257,14 +274,6 @@ ExternalProject_Add(airspy PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspy" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LIBRARIES} ) -# apt install libairspyhf-dev (only on ubuntu 18.04) -# needs libusb and pkgconfig -ExternalProject_Add(airspyhf - GIT_REPOSITORY https://github.com/airspy/airspyhf.git - GIT_TAG 1.1.5 - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/airspyhf" - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LIBRARIES} -) # apt install libhackrf-dev # needs pkgconfig, libusb and fftw-3 ExternalProject_Add(hackrf diff --git a/plugins/samplesource/airspyhf/CMakeLists.txt b/plugins/samplesource/airspyhf/CMakeLists.txt index 4734c8396..f7a74e623 100644 --- a/plugins/samplesource/airspyhf/CMakeLists.txt +++ b/plugins/samplesource/airspyhf/CMakeLists.txt @@ -46,6 +46,10 @@ add_library(${TARGET_NAME} SHARED ${airspyhf_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(${TARGET_NAME} airspyhf) +endif() + target_link_libraries(${TARGET_NAME} Qt5::Core ${TARGET_LIB}