Server: added build subdirectory for plugins without GUI

This commit is contained in:
f4exb 2017-12-17 10:25:08 +01:00
parent 48e29c275f
commit eceb3ac68d
15 changed files with 421 additions and 9 deletions

View File

@ -253,6 +253,7 @@ endif (BUILD_DEBIAN)
add_subdirectory(devices)
add_subdirectory(plugins)
add_subdirectory(pluginssrv)
if(LIBUSB_FOUND AND UNIX)
add_subdirectory(fcdhid)

View File

@ -0,0 +1,6 @@
project(pluginssrv)
add_subdirectory(channelrx)
add_subdirectory(channeltx)
add_subdirectory(samplesink)
add_subdirectory(samplesource)

View File

@ -0,0 +1,3 @@
project(demod)
add_subdirectory(demodnfm)

View File

@ -0,0 +1,44 @@
project(nfm)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/channelrx/demodnfm")
set(nfm_SOURCES
${PLUGIN_PREFIX}/nfmdemod.cpp
${PLUGIN_PREFIX}/nfmdemodsettings.cpp
${PLUGIN_PREFIX}/nfmplugin.cpp
)
set(nfm_HEADERS
${PLUGIN_PREFIX}/nfmdemod.h
${PLUGIN_PREFIX}/nfmdemodsettings.h
${PLUGIN_PREFIX}/nfmplugin.h
)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(demodnfmsrv SHARED
${nfm_SOURCES}
${nfm_HEADERS_MOC}
${nfm_FORMS_HEADERS}
)
target_link_libraries(demodnfmsrv
${QT_LIBRARIES}
sdrbase
sdrgui
swagger
)
qt5_use_modules(demodnfmsrv Core)
install(TARGETS demodnfmsrv DESTINATION lib/pluginssrv/channelrx)

View File

@ -0,0 +1,3 @@
project(mod)
add_subdirectory(modnfm)

View File

@ -0,0 +1,43 @@
project(modnfm)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/channeltx/modnfm")
set(modnfm_SOURCES
${PLUGIN_PREFIX}/nfmmod.cpp
${PLUGIN_PREFIX}/nfmmodplugin.cpp
${PLUGIN_PREFIX}/nfmmodsettings.cpp
)
set(modnfm_HEADERS
${PLUGIN_PREFIX}/nfmmod.h
${PLUGIN_PREFIX}/nfmmodplugin.h
${PLUGIN_PREFIX}/nfmmodsettings.h
)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(modnfmsrv SHARED
${modnfm_SOURCES}
${modnfm_HEADERS_MOC}
${modnfm_FORMS_HEADERS}
)
target_link_libraries(modnfmsrv
${QT_LIBRARIES}
sdrbase
sdrgui
swagger
)
qt5_use_modules(modnfmsrv Core)
install(TARGETS modnfmsrv DESTINATION lib/pluginssrv/channeltx)

3
pluginssrv/readme.md Normal file
View File

@ -0,0 +1,3 @@
<h1>Plugins for SDRangel server</h1>
This is a build only subdirectory using the same structure and sources as in the `plugins` subdirectory. The plugins here are compiled without GUI and reference to Qt Widgets and are to be used with the server (headless) version of SDRangel through the `MainCore` class.

View File

@ -0,0 +1,12 @@
project(samplesink)
find_package(LibUSB)
find_package(LimeSuite)
if(LIBUSB_FOUND AND LIMESUITE_FOUND)
add_subdirectory(limesdroutput)
endif(LIBUSB_FOUND AND LIMESUITE_FOUND)
if (BUILD_DEBIAN)
add_subdirectory(limesdroutput)
endif (BUILD_DEBIAN)

View File

@ -0,0 +1,79 @@
project(limesdroutput)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesink/limesdroutput")
set(limesdroutput_SOURCES
${PLUGIN_PREFIX}/limesdroutput.cpp
${PLUGIN_PREFIX}/limesdroutputplugin.cpp
${PLUGIN_PREFIX}/limesdroutputsettings.cpp
${PLUGIN_PREFIX}/limesdroutputthread.cpp
)
set(limesdroutput_HEADERS
${PLUGIN_PREFIX}/limesdroutput.h
${PLUGIN_PREFIX}/limesdroutputplugin.h
${PLUGIN_PREFIX}/limesdroutputsettings.h
${PLUGIN_PREFIX}/limesdroutputthread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBLIMESUITESRC}/src
${LIBLIMESUITESRC}/src/ADF4002
${LIBLIMESUITESRC}/src/ConnectionRegistry
${LIBLIMESUITESRC}/src/FPGA_common
${LIBLIMESUITESRC}/src/GFIR
${LIBLIMESUITESRC}/src/lms7002m
${LIBLIMESUITESRC}/src/lms7002m_mcu
${LIBLIMESUITESRC}/src/Si5351C
${LIBLIMESUITESRC}/src/protocols
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIMESUITE_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(outputlimesdrsrv SHARED
${limesdroutput_SOURCES}
${limesdroutput_HEADERS_MOC}
${limesdroutput_FORMS_HEADERS}
)
if (BUILD_DEBIAN)
target_link_libraries(outputlimesdrsrv
${QT_LIBRARIES}
limesuite
sdrbase
sdrgui
swagger
limesdrdevice
)
else (BUILD_DEBIAN)
target_link_libraries(outputlimesdrsrv
${QT_LIBRARIES}
${LIMESUITE_LIBRARY}
sdrbase
sdrgui
swagger
limesdrdevice
)
endif (BUILD_DEBIAN)
qt5_use_modules(outputlimesdrsrv Core)
install(TARGETS outputlimesdrsrv DESTINATION lib/pluginssrv/samplesink)

View File

@ -0,0 +1,29 @@
project(samplesource)
find_package(LibUSB)
if(V4L-RTL)
FIND_LIBRARY (LIBV4L2 v4l2)
FIND_PATH (LIBV4L2H libv4l2.h)
# add_subdirectory(v4l-rtl)
endif()
if(V4L-MSI)
FIND_LIBRARY (LIBV4L2 v4l2)
FIND_PATH (LIBV4L2H libv4l2.h)
# add_subdirectory(v4l-msi)
endif()
find_package(LimeSuite)
if(LIBUSB_FOUND AND LIMESUITE_FOUND)
add_subdirectory(limesdrinput)
endif(LIBUSB_FOUND AND LIMESUITE_FOUND)
find_package(LibRTLSDR)
if(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
add_subdirectory(rtlsdr)
endif(LIBUSB_FOUND AND LIBRTLSDR_FOUND)
if (BUILD_DEBIAN)
add_subdirectory(rtlsdr)
endif (BUILD_DEBIAN)

View File

@ -0,0 +1,79 @@
project(limesdrinput)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesource/limesdrinput")
set(limesdrinput_SOURCES
${PLUGIN_PREFIX}/limesdrinput.cpp
${PLUGIN_PREFIX}/limesdrinputplugin.cpp
${PLUGIN_PREFIX}/limesdrinputsettings.cpp
${PLUGIN_PREFIX}/limesdrinputthread.cpp
)
set(limesdrinput_HEADERS
${PLUGIN_PREFIX}/limesdrinput.h
${PLUGIN_PREFIX}/limesdrinputplugin.h
${PLUGIN_PREFIX}/limesdrinputsettings.h
${PLUGIN_PREFIX}/limesdrinputthread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIBLIMESUITESRC}/src
${LIBLIMESUITESRC}/src/ADF4002
${LIBLIMESUITESRC}/src/ConnectionRegistry
${LIBLIMESUITESRC}/src/FPGA_common
${LIBLIMESUITESRC}/src/GFIR
${LIBLIMESUITESRC}/src/lms7002m
${LIBLIMESUITESRC}/src/lms7002m_mcu
${LIBLIMESUITESRC}/src/Si5351C
${LIBLIMESUITESRC}/src/protocols
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${CMAKE_SOURCE_DIR}/devices
${LIMESUITE_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(inputlimesdrsrv SHARED
${limesdrinput_SOURCES}
${limesdrinput_HEADERS_MOC}
${limesdrinput_FORMS_HEADERS}
)
if (BUILD_DEBIAN)
target_link_libraries(inputlimesdrsrv
${QT_LIBRARIES}
limesuite
sdrbase
sdrgui
swagger
limesdrdevice
)
else (BUILD_DEBIAN)
target_link_libraries(inputlimesdrsrv
${QT_LIBRARIES}
${LIMESUITE_LIBRARY}
sdrbase
sdrgui
swagger
limesdrdevice
)
endif (BUILD_DEBIAN)
qt5_use_modules(inputlimesdrsrv Core)
install(TARGETS inputlimesdrsrv DESTINATION lib/pluginssrv/samplesource)

View File

@ -0,0 +1,68 @@
project(rtlsdr)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(PLUGIN_PREFIX "../../../plugins/samplesource/rtlsdr")
set(rtlsdr_SOURCES
${PLUGIN_PREFIX}/rtlsdrinput.cpp
${PLUGIN_PREFIX}/rtlsdrplugin.cpp
${PLUGIN_PREFIX}/rtlsdrsettings.cpp
${PLUGIN_PREFIX}/rtlsdrthread.cpp
)
set(rtlsdr_HEADERS
${PLUGIN_PREFIX}/rtlsdrinput.h
${PLUGIN_PREFIX}/rtlsdrplugin.h
${PLUGIN_PREFIX}/rtlsdrsettings.h
${PLUGIN_PREFIX}/rtlsdrthread.h
)
if (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBRTLSDRSRC}/include
${LIBRTLSDRSRC}/src
)
else (BUILD_DEBIAN)
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
${LIBRTLSDR_INCLUDE_DIR}
)
endif (BUILD_DEBIAN)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_library(inputrtlsdrsrv SHARED
${rtlsdr_SOURCES}
${rtlsdr_HEADERS_MOC}
)
if (BUILD_DEBIAN)
target_link_libraries(inputrtlsdrsrv
${QT_LIBRARIES}
rtlsdr
sdrbase
sdrgui
swagger
)
else (BUILD_DEBIAN)
target_link_libraries(inputrtlsdrsrv
${QT_LIBRARIES}
${LIBRTLSDR_LIBRARIES}
sdrbase
sdrgui
swagger
)
endif (BUILD_DEBIAN)
qt5_use_modules(inputrtlsdrsrv Core)
install(TARGETS inputrtlsdrsrv DESTINATION lib/pluginssrv/samplesource)

View File

@ -66,15 +66,6 @@ void PluginManager::loadPlugins()
loadPlugins(pluginsLibDir);
loadPlugins(pluginsBuildDir);
// QString applicationLibPath = applicationDirPath + "/../lib/plugins";
// qDebug() << "PluginManager::loadPlugins: " << qPrintable(applicationDirPath) << ", " << qPrintable(applicationLibPath);
//
// QDir pluginsBinDir = QDir(applicationDirPath);
// QDir pluginsLibDir = QDir(applicationLibPath);
//
// loadPlugins(pluginsBinDir);
// loadPlugins(pluginsLibDir);
qSort(m_plugins);
for (Plugins::const_iterator it = m_plugins.begin(); it != m_plugins.end(); ++it)

47
sdrsrv/maincore.h Normal file
View File

@ -0,0 +1,47 @@
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017 Edouard Griffiths, F4EXB. //
// //
// Swagger server adapter interface //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef SDRSRV_MAINCORE_H_
#define SDRSRV_MAINCORE_H_
#include <QObject>
#include "util/export.h"
class AudioDeviceInfo;
class DSPEngine;
class DSPDeviceSourceEngine;
class DSPDeviceSinkEngine;
class DeviceSourceAPI;
class DeviceSinkAPI;
class PluginAPI;
class PluginInterface;
class PluginManager;
class ChannelMarker;
class DeviceSet; // TODO: create this class
class WebAPIRequestMapper;
class WebAPIServer;
class WebAPIAdapterSrv; // TODO: create this class
class SDRANGEL_API MainCore : public QObject {
Q_OBJECT
};
#endif /* SDRSRV_MAINCORE_H_ */

4
sdrsrv/readme.md Normal file
View File

@ -0,0 +1,4 @@
<h1>SDRangel Server</h1>
This folder holds the objects specific to the server (headless) version of SDRangel. The `MainCore` class is the headless equivalent of the `MainWindow` class in the GUI version and plays the same central role. This document focuses on the functional description of SDRangel server. More details on the technical architecture can be found in the developer's documentation.