From 8f111b2e7bfda4e5bd475c4cff38250a7101739a Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 6 Mar 2019 21:40:05 +0100 Subject: [PATCH] Reinstated XTRX from server build with fixes --- pluginssrv/samplesink/CMakeLists.txt | 15 ++++-- .../samplesink/xtrxoutput/CMakeLists.txt | 47 ++++++++++++++++++ pluginssrv/samplesource/CMakeLists.txt | 5 ++ .../samplesource/xtrxinput/CMakeLists.txt | 48 +++++++++++++++++++ 4 files changed, 110 insertions(+), 5 deletions(-) create mode 100644 pluginssrv/samplesink/xtrxoutput/CMakeLists.txt create mode 100644 pluginssrv/samplesource/xtrxinput/CMakeLists.txt diff --git a/pluginssrv/samplesink/CMakeLists.txt b/pluginssrv/samplesink/CMakeLists.txt index 680b03be4..11060d77f 100644 --- a/pluginssrv/samplesink/CMakeLists.txt +++ b/pluginssrv/samplesink/CMakeLists.txt @@ -23,16 +23,21 @@ if(LIBUSB_FOUND AND LIBIIO_FOUND) add_subdirectory(plutosdroutput) endif(LIBUSB_FOUND AND LIBIIO_FOUND) +find_package(LibXTRX) +if(LIBXTRX_FOUND) + add_subdirectory(xtrxoutput) +endif(LIBXTRX_FOUND) + +find_package(SoapySDR) +if(LIBUSB_FOUND AND SOAPYSDR_FOUND) +add_subdirectory(soapysdroutput) +endif() + find_package(CM256cc) if(CM256CC_FOUND) add_subdirectory(remoteoutput) endif(CM256CC_FOUND) -find_package(SoapySDR) -if(LIBUSB_FOUND AND SOAPYSDR_FOUND) - add_subdirectory(soapysdroutput) -endif() - if (BUILD_DEBIAN) add_subdirectory(bladerf1output) add_subdirectory(bladerf2output) diff --git a/pluginssrv/samplesink/xtrxoutput/CMakeLists.txt b/pluginssrv/samplesink/xtrxoutput/CMakeLists.txt new file mode 100644 index 000000000..1725591d5 --- /dev/null +++ b/pluginssrv/samplesink/xtrxoutput/CMakeLists.txt @@ -0,0 +1,47 @@ +project(xtrxoutput) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/samplesink/xtrxoutput") + +set(xtrxoutput_SOURCES + ${PLUGIN_PREFIX}/xtrxoutput.cpp + ${PLUGIN_PREFIX}/xtrxoutputplugin.cpp + ${PLUGIN_PREFIX}/xtrxoutputsettings.cpp + ${PLUGIN_PREFIX}/xtrxoutputthread.cpp +) + +set(xtrxoutput_HEADERS + ${PLUGIN_PREFIX}/xtrxoutput.h + ${PLUGIN_PREFIX}/xtrxoutputplugin.h + ${PLUGIN_PREFIX}/xtrxoutputsettings.h + ${PLUGIN_PREFIX}/xtrxoutputthread.h +) + +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${CMAKE_SOURCE_DIR}/devices + ${LIBXTRX_INCLUDE_DIRS} +) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(outputxtrxsrv SHARED + ${xtrxoutput_SOURCES} + ${xtrxoutput_HEADERS_MOC} +) + +target_link_libraries(outputxtrxsrv + ${QT_LIBRARIES} + ${LIBXTRX_LIBRARY} + sdrbase + swagger + xtrxdevice +) + +target_link_libraries(outputxtrxsrv Qt5::Core) + +install(TARGETS outputxtrxsrv DESTINATION lib/pluginssrv/samplesink) diff --git a/pluginssrv/samplesource/CMakeLists.txt b/pluginssrv/samplesource/CMakeLists.txt index d74f159ac..690f487c9 100644 --- a/pluginssrv/samplesource/CMakeLists.txt +++ b/pluginssrv/samplesource/CMakeLists.txt @@ -77,6 +77,11 @@ else(LIBUSB_FOUND AND LIBMIRISDR_FOUND) message(STATUS "LibMiriSDR NOT found") endif(LIBUSB_FOUND AND LIBMIRISDR_FOUND) +find_package(LibXTRX) +if(LIBXTRX_FOUND) + add_subdirectory(xtrxinput) +endif(LIBXTRX_FOUND) + find_package(SoapySDR) if(LIBUSB_FOUND AND SOAPYSDR_FOUND) add_subdirectory(soapysdrinput) diff --git a/pluginssrv/samplesource/xtrxinput/CMakeLists.txt b/pluginssrv/samplesource/xtrxinput/CMakeLists.txt new file mode 100644 index 000000000..d95e2deb8 --- /dev/null +++ b/pluginssrv/samplesource/xtrxinput/CMakeLists.txt @@ -0,0 +1,48 @@ +project(xtrxinput) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/samplesource/xtrxinput") + +set(xtrxinput_SOURCES + ${PLUGIN_PREFIX}/xtrxinput.cpp + ${PLUGIN_PREFIX}/xtrxinputplugin.cpp + ${PLUGIN_PREFIX}/xtrxinputsettings.cpp + ${PLUGIN_PREFIX}/xtrxinputthread.cpp +) + +set(xtrxinput_HEADERS + ${PLUGIN_PREFIX}/xtrxinput.h + ${PLUGIN_PREFIX}/xtrxinputplugin.h + ${PLUGIN_PREFIX}/xtrxinputsettings.h + ${PLUGIN_PREFIX}/xtrxinputthread.h +) + +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${CMAKE_SOURCE_DIR}/devices + ${LIBXTRX_INCLUDE_DIRS} +) + +add_definitions(${QT_DEFINITIONS}) +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(inputxtrxsrv SHARED + ${xtrxinput_SOURCES} + ${xtrxinput_HEADERS_MOC} +) + + +target_link_libraries(inputxtrxsrv + ${QT_LIBRARIES} + ${LIBXTRX_LIBRARY} + sdrbase + swagger + xtrxdevice +) + +qt5_use_modules(inputxtrxsrv Core) + +install(TARGETS inputxtrxsrv DESTINATION lib/pluginssrv/samplesource) \ No newline at end of file