diff --git a/devices/plutosdr/CMakeLists.txt b/devices/plutosdr/CMakeLists.txt index 9799dc162..4162c94fa 100644 --- a/devices/plutosdr/CMakeLists.txt +++ b/devices/plutosdr/CMakeLists.txt @@ -25,6 +25,10 @@ add_library(plutosdrdevice SHARED ${plutosdrdevice_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(plutosdrdevice libiio) +endif() + set_target_properties(plutosdrdevice PROPERTIES DEFINE_SYMBOL "devices_EXPORTS") diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 4f7e7de08..0a0e250df 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -15,6 +15,7 @@ set(SERIALDV_TAG abd65a0fc2d5339808194862d14119b0cba70424) set(DSDCC_TAG 952fb5f5f7bf1928a290ad62acce35492df13f5d) set(LIMESUITE_TAG "v19.01.0") set(BLADERF_TAG 896d2431b3a35a4b31b6e729386202ebf5fdc5c0) +set(LIBIIO_TAG 826563e41b5ce9890b75506f672017de8d76d52d) # For some external project macros @@ -213,6 +214,20 @@ if (LINUX) set(LIBBLADERF_FOUND ON CACHE INTERNAL "") set(LIBBLADERF_INCLUDE_DIRS "${EXTERNAL_BUILD_LIBRARIES}/bladerf/src/bladerf/host/libraries/libbladeRF/include" CACHE INTERNAL "") set(LIBBLADERF_LIBRARIES "${EXTERNAL_BUILD_LIBRARIES}/lib/libbladeRF.so" CACHE INTERNAL "") + + # apt install libiio-dev + # needs pkgconfig, libusb, libxml2, lzma, xz, libiconv + ExternalProject_Add(libiio + GIT_REPOSITORY https://github.com/analogdevicesinc/libiio.git + GIT_TAG ${LIBIIO_TAG} + PREFIX "${EXTERNAL_BUILD_LIBRARIES}/libiio" + CMAKE_ARGS ${DEFAULT_OUTPUT_DIRECTORY} -DOSX_PACKAGE=OFF -DWITH_DOC=OFF + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + 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 "") endif() # already on the respository diff --git a/plugins/samplesink/plutosdroutput/CMakeLists.txt b/plugins/samplesink/plutosdroutput/CMakeLists.txt index f4820c642..86bf894f4 100644 --- a/plugins/samplesink/plutosdroutput/CMakeLists.txt +++ b/plugins/samplesink/plutosdroutput/CMakeLists.txt @@ -47,6 +47,10 @@ add_library(${TARGET_NAME} SHARED ${plutosdroutput_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(${TARGET_NAME} libiio) +endif() + target_link_libraries(${TARGET_NAME} Qt5::Core ${TARGET_LIB} diff --git a/plugins/samplesource/plutosdrinput/CMakeLists.txt b/plugins/samplesource/plutosdrinput/CMakeLists.txt index e1d4d93f7..4fd30fa26 100644 --- a/plugins/samplesource/plutosdrinput/CMakeLists.txt +++ b/plugins/samplesource/plutosdrinput/CMakeLists.txt @@ -47,6 +47,10 @@ add_library(${TARGET_NAME} SHARED ${plutosdrinput_SOURCES} ) +if(ENABLE_EXTERNAL_LIBRARIES) + add_dependencies(${TARGET_NAME} libiio) +endif() + target_link_libraries(${TARGET_NAME} Qt5::Core ${TARGET_LIB}