From 356d5b80100d5508b0ea48aa79cf7f635ec2ba92 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 2 Jun 2019 01:05:33 +0200 Subject: [PATCH] Build: Linux: added LimeSuite external library --- devices/limesdr/CMakeLists.txt | 4 +++ external/CMakeLists.txt | 25 +++++++++++++------ .../samplesink/limesdroutput/CMakeLists.txt | 4 +++ .../samplesource/limesdrinput/CMakeLists.txt | 4 +++ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/devices/limesdr/CMakeLists.txt b/devices/limesdr/CMakeLists.txt index c0cdd5fb2..1a03543ab 100644 --- a/devices/limesdr/CMakeLists.txt +++ b/devices/limesdr/CMakeLists.txt @@ -20,6 +20,10 @@ add_library(limesdrdevice SHARED ${limesdrdevice_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(limesdrdevice limesuite) +endif() + set_target_properties(limesdrdevice PROPERTIES DEFINE_SYMBOL "devices_EXPORTS") diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index ba0300a67..bcb3d0f6d 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -13,6 +13,7 @@ set(CM256CC_TAG f21e8bc1e9afdb0b28672743dcec111aec1d32d9) set(MBELIB_TAG "debian/1.3.0") set(SERIALDV_TAG abd65a0fc2d5339808194862d14119b0cba70424) set(DSDCC_TAG 952fb5f5f7bf1928a290ad62acce35492df13f5d) +set(LIMESUITE_TAG "v19.01.0") # For some external project macros @@ -180,6 +181,22 @@ else() set(LIBDSDCC_LIBRARIES "${binary_dir}/libdsdcc${CMAKE_SHARED_LIBRARY_SUFFIX}" CACHE INTERNAL "") endif() +if (LINUX) + # apt install liblimesuite-dev (only on ubuntu 18.04). Can be picky on version though so let's build it. Linux only for now. + # needs pkgconfig, libusb and sqlite3 + ExternalProject_Add(limesuite + GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git + GIT_TAG ${LIMESUITE_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite" + CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORY} -DLIME_SUITE_EXTVER=release -DENABLE_GUI=OFF -DENABLE_NOVENARF7=OFF -DENABLE_SOAPY_LMS7=OFF -DENABLE_OCTAVE=OFF + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + set(LIMESUITE_FOUND ON CACHE INTERNAL "") + set(LIMESUITE_INCLUDE_DIR "${EXTERNAL_BUILD_LIBRARIES}/limesuite/src/limesuite/src" CACHE INTERNAL "") + set(LIMESUITE_LIBRARY "${EXTERNAL_BUILD_LIBRARIES}/lib/libLimeSuite.so" CACHE INTERNAL "") +endif() + # already on the respository # TODO decide what to do if(OFF) @@ -241,14 +258,6 @@ ExternalProject_Add(bladerf PREFIX "${EXTERNAL_BUILD_LIBRARIES}/bladerf" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LIBRARIES} ) -# apt install liblimesuite-dev (only on ubuntu 18.04) -# needs pkgconfig, libusb and sqlite3 -ExternalProject_Add(limesuite - GIT_REPOSITORY https://github.com/myriadrf/LimeSuite.git - GIT_TAG v19.01.0 - PREFIX "${EXTERNAL_BUILD_LIBRARIES}/limesuite" - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LIBRARIES} -DLIME_SUITE_EXTVER=release -DENABLE_GUI=OFF -DENABLE_NOVENARF7=OFF -DENABLE_SOAPY_LMS7=OFF -DENABLE_OCTAVE=OFF -) # apt install libmirisdr-dev # needs pkgconfig and libusb ExternalProject_Add(mirisdr diff --git a/plugins/samplesink/limesdroutput/CMakeLists.txt b/plugins/samplesink/limesdroutput/CMakeLists.txt index 8b637de58..883ce7810 100644 --- a/plugins/samplesink/limesdroutput/CMakeLists.txt +++ b/plugins/samplesink/limesdroutput/CMakeLists.txt @@ -47,6 +47,10 @@ add_library(${TARGET_NAME} SHARED ${limesdroutput_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(${TARGET_NAME} limesuite) +endif() + target_link_libraries(${TARGET_NAME} Qt5::Core ${TARGET_LIB} diff --git a/plugins/samplesource/limesdrinput/CMakeLists.txt b/plugins/samplesource/limesdrinput/CMakeLists.txt index 2f6c36e22..c4ab26649 100644 --- a/plugins/samplesource/limesdrinput/CMakeLists.txt +++ b/plugins/samplesource/limesdrinput/CMakeLists.txt @@ -47,6 +47,10 @@ add_library(${TARGET_NAME} SHARED ${limesdrinput_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(${TARGET_NAME} limesuite) +endif() + target_link_libraries(${TARGET_NAME} Qt5::Core ${TARGET_LIB}