diff --git a/plugins/samplesource/airspy/airspyinput.cpp b/plugins/samplesource/airspy/airspyinput.cpp index a78ab4ff3..a22bd51d3 100644 --- a/plugins/samplesource/airspy/airspyinput.cpp +++ b/plugins/samplesource/airspy/airspyinput.cpp @@ -24,7 +24,6 @@ #include "SWGDeviceReport.h" #include "SWGAirspyReport.h" -#include "airspygui.h" #include "airspyinput.h" #include "airspyplugin.h" diff --git a/plugins/samplesource/airspy/airspyplugin.cpp b/plugins/samplesource/airspy/airspyplugin.cpp index 91eadbb08..a3a65cf75 100644 --- a/plugins/samplesource/airspy/airspyplugin.cpp +++ b/plugins/samplesource/airspy/airspyplugin.cpp @@ -15,10 +15,13 @@ /////////////////////////////////////////////////////////////////////////////////// #include -#include #include +#ifdef SERVER_MODE +#include "airspyinput.h" +#else #include "airspygui.h" +#endif #include "airspyplugin.h" #include @@ -125,6 +128,15 @@ PluginInterface::SamplingDevices AirspyPlugin::enumSampleSources() return result; } +#ifdef SERVER_MODE +PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI( + const QString& sourceId __attribute__((unused)), + QWidget **widget __attribute__((unused)), + DeviceUISet *deviceUISet __attribute__((unused))) +{ + return 0; +} +#else PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI( const QString& sourceId, QWidget **widget, @@ -141,6 +153,7 @@ PluginInstanceGUI* AirspyPlugin::createSampleSourcePluginInstanceGUI( return 0; } } +#endif DeviceSampleSource *AirspyPlugin::createSampleSourcePluginInstanceInput(const QString& sourceId, DeviceSourceAPI *deviceAPI) { diff --git a/pluginssrv/samplesource/CMakeLists.txt b/pluginssrv/samplesource/CMakeLists.txt index 075a0727f..a556439a2 100644 --- a/pluginssrv/samplesource/CMakeLists.txt +++ b/pluginssrv/samplesource/CMakeLists.txt @@ -13,6 +13,11 @@ if(V4L-MSI) # add_subdirectory(v4l-msi) endif() +find_package(LibAIRSPY) +if(LIBUSB_FOUND AND LIBAIRSPY_FOUND) + add_subdirectory(airspy) +endif(LIBUSB_FOUND AND LIBAIRSPY_FOUND) + find_package(LibAIRSPYHF) if(LIBUSB_FOUND AND LIBAIRSPYHF_FOUND) add_subdirectory(airspyhf) @@ -39,6 +44,7 @@ if(LIBUSB_FOUND AND LIBRTLSDR_FOUND) endif(LIBUSB_FOUND AND LIBRTLSDR_FOUND) if (BUILD_DEBIAN) + add_subdirectory(airspy) add_subdirectory(airspyhf) add_subdirectory(hackrfinput) add_subdirectory(limesdrinput) diff --git a/pluginssrv/samplesource/airspy/CMakeLists.txt b/pluginssrv/samplesource/airspy/CMakeLists.txt new file mode 100644 index 000000000..2ce19f4f6 --- /dev/null +++ b/pluginssrv/samplesource/airspy/CMakeLists.txt @@ -0,0 +1,65 @@ +project(airspy) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +set(PLUGIN_PREFIX "../../../plugins/samplesource/airspy") + +set(airspy_SOURCES + ${PLUGIN_PREFIX}/airspyinput.cpp + ${PLUGIN_PREFIX}/airspyplugin.cpp + ${PLUGIN_PREFIX}/airspysettings.cpp + ${PLUGIN_PREFIX}/airspythread.cpp +) + +set(airspy_HEADERS + ${PLUGIN_PREFIX}/airspyinput.h + ${PLUGIN_PREFIX}/airspyplugin.h + ${PLUGIN_PREFIX}/airspysettings.h + ${PLUGIN_PREFIX}/airspythread.h +) + +if (BUILD_DEBIAN) +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${LIBAIRSPYSRC} + ${LIBAIRSPYSRC}/libairspy/src +) +else (BUILD_DEBIAN) +include_directories( + . + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${LIBAIRSPY_INCLUDE_DIR} +) +endif (BUILD_DEBIAN) + +add_definitions("${QT_DEFINITIONS} -DLIBAIRSPY_DYN_RATES") +add_definitions(-DQT_PLUGIN) +add_definitions(-DQT_SHARED) + +add_library(inputairspysrv SHARED + ${airspy_SOURCES} + ${airspy_HEADERS_MOC} +) + +if (BUILD_DEBIAN) +target_link_libraries(inputairspysrv + ${QT_LIBRARIES} + airspy + sdrbase + swagger +) +else (BUILD_DEBIAN) +target_link_libraries(inputairspysrv + ${QT_LIBRARIES} + ${LIBAIRSPY_LIBRARIES} + sdrbase + swagger +) +endif (BUILD_DEBIAN) + + +qt5_use_modules(inputairspysrv Core) + +install(TARGETS inputairspysrv DESTINATION lib/pluginssrv/samplesource)