1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

manage "correctly" plugins/pluginssrv folders

This commit is contained in:
Davide Gerhard 2019-05-01 15:17:27 +02:00
parent dcfb7f6c97
commit 23498ab24b
No known key found for this signature in database
GPG Key ID: 7CBEFA144857DC97
50 changed files with 215 additions and 195 deletions

View File

@ -14,12 +14,16 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
# declare build structures
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/sdrangel)
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/sdrangel)
# !! change sdrbase/plugin/pluginmanager.cpp too !!
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(BUILD_PLUGINS_DIR ${CMAKE_BINARY_DIR}/lib/plugins)
set(BUILD_PLUGINSSRV_DIR ${CMAKE_BINARY_DIR}/lib/pluginssrv)
set(INSTALL_BIN_DIR "bin/")
set(INSTALL_LIB_DIR "lib/sdrangel")
# set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/sdrangel")
set(INSTALL_PLUGINS_DIR ${INSTALL_LIB_DIR}/plugins)
set(INSTALL_PLUGINSSRV_DIR ${INSTALL_LIB_DIR}/pluginssrv)
# SDRAngel cmake options
option(DEBUG_OUTPUT "Print debug messages" OFF)

View File

@ -6,6 +6,14 @@ include_directories(
${CMAKE_SOURCE_DIR}/sdrgui
)
if (NOT SERVER_MODE)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_PLUGINS_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BUILD_PLUGINS_DIR})
else()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_PLUGINSSRV_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BUILD_PLUGINSSRV_DIR})
endif()
add_subdirectory(channelrx)
add_subdirectory(channeltx)
add_subdirectory(samplesource)

View File

@ -32,4 +32,4 @@ target_link_libraries(chanalyzer
sdrgui
)
install(TARGETS chanalyzer DESTINATION ${INSTALL_LIB_DIR}/plugins/channelrx)
install(TARGETS chanalyzer DESTINATION ${INSTALL_PLUGINS_DIR})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demodam)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodamsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -55,4 +55,4 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,4 +32,4 @@ target_link_libraries(demodatv
sdrgui
)
install(TARGETS demodatv DESTINATION ${INSTALL_LIB_DIR}/plugins/channelrx)
install(TARGETS demodatv DESTINATION ${INSTALL_PLUGINS_DIR})

View File

@ -41,12 +41,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demodbfm)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodbfmsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -60,4 +60,4 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -58,4 +58,4 @@ target_link_libraries(demoddatv
${SWRESAMPLE_LIBRARIES}
)
install(TARGETS demoddatv DESTINATION ${INSTALL_LIB_DIR}/plugins/channelrx)
install(TARGETS demoddatv DESTINATION ${INSTALL_PLUGINS_DIR})

View File

@ -41,12 +41,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demoddsd)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demoddsdsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -62,4 +62,4 @@ target_link_libraries(${TARGET_NAME}
${LIBMBE_LIBRARY}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -34,12 +34,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demodfreedv)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodfreedvsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -56,4 +56,4 @@ target_link_libraries(${TARGET_NAME}
${CODEC2_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -31,4 +31,4 @@ target_link_libraries(demodlora
sdrgui
)
install(TARGETS demodlora DESTINATION ${INSTALL_LIB_DIR}/plugins/channelrx)
install(TARGETS demodlora DESTINATION ${INSTALL_PLUGINS_DIR})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demodnfm)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodnfmsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demodssb)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodssbsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME demodwfm)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME demodwfmsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -51,4 +51,4 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -44,12 +44,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME remotesink)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME remotesinksrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -65,4 +65,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME udpsink)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME udpsinksrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
${TARGET_LIB_GUI}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channelrx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME modam)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME modamsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -33,12 +33,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME modatv)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME modatvsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -54,4 +54,4 @@ target_link_libraries(${TARGET_NAME}
${OpenCV_LIBS}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -34,12 +34,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME modfreedv)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME modfreedvsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -56,4 +56,4 @@ target_link_libraries(${TARGET_NAME}
${CODEC2_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME modnfm)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME modnfmsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME modssb)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME modssbsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -32,12 +32,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME modwfm)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME modwfmsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -52,4 +52,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -44,12 +44,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME remotesource)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME remotesourcesrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -66,4 +66,4 @@ target_link_libraries(${TARGET_NAME}
${CM256CC_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME udpsource)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME udpsourcesrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -57,4 +57,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/channeltx)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputbladerf1)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputbladerf1srv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
bladerf1device
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputbladerf2)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputbladerf2srv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
bladerf2device
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -34,12 +34,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputfilesink)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputfilesinksrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -54,4 +54,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputhackrf)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputhackrfsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
hackrfdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputlimesdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputlimesdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
limesdrdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputplutosdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputplutosdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
plutosdrdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -69,4 +69,4 @@ target_link_libraries(${TARGET_NAME}
${CM256CC_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputsoapysdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputsoapysdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
soapysdrdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME outputxtrx)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME outputxtrxsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
xtrxdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesink)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -35,12 +35,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputairspy)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputairspysrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -56,4 +56,4 @@ target_link_libraries(${TARGET_NAME}
${LIBAIRSPY_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -35,12 +35,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputairspyhf)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputairspyhfsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -56,4 +56,4 @@ target_link_libraries(${TARGET_NAME}
${LIBAIRSPYHF_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputbladerf1)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputbladerf1srv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
bladerf1device
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputbladerf2)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputbladerf2srv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
bladerf2device
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputfcdpro)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputfcdprosrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
fcdlib
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputfcdproplus)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputfcdproplussrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
fcdlib
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -34,12 +34,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputfilesource)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputfilesourcesrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -54,4 +54,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputhackrf)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputhackrfsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
hackrfdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputlimesdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputlimesdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
limesdrdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputperseus)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputperseussrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
perseusdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputplutosdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputplutosdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
plutosdrdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -46,12 +46,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputremote)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputremotesrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -67,4 +67,4 @@ target_link_libraries(${TARGET_NAME}
${CM256CC_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -34,12 +34,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputrtlsdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputrtlsdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -55,4 +55,4 @@ target_link_libraries(${TARGET_NAME}
${LIBRTLSDR_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -35,12 +35,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputsdrplay)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputsdrplaysrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -56,4 +56,4 @@ target_link_libraries(${TARGET_NAME}
${LIBMIRISDR_LIBRARIES}
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputsoapysdr)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputsoapysdrsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
soapysdrdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -34,12 +34,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputtestsource)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputtestsourcesrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -54,4 +54,4 @@ target_link_libraries(${TARGET_NAME}
swagger
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -36,12 +36,12 @@ if(NOT SERVER_MODE)
set(TARGET_NAME inputxtrx)
set(TARGET_LIB "Qt5::Widgets")
set(TARGET_LIB_GUI "sdrgui")
set(INSTALL_FOLDER "plugins")
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR})
else()
set(TARGET_NAME inputxtrxsrv)
set(TARGET_LIB "")
set(TARGET_LIB_GUI "")
set(INSTALL_FOLDER "pluginssrv")
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR})
endif()
add_library(${TARGET_NAME} SHARED
@ -58,4 +58,4 @@ target_link_libraries(${TARGET_NAME}
xtrxdevice
)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_LIB_DIR}/${INSTALL_FOLDER}/samplesource)
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER})

View File

@ -53,7 +53,7 @@ PluginManager::PluginManager(QObject* parent) :
PluginManager::~PluginManager()
{
// freeAll();
// freeAll();
}
void PluginManager::loadPlugins(const QString& pluginsSubDir)
@ -65,19 +65,38 @@ void PluginManager::loadPlugins(const QString& pluginsSubDir)
void PluginManager::loadPluginsPart(const QString& pluginsSubDir)
{
QString applicationDirPath = QCoreApplication::instance()->applicationDirPath();
QString applicationLibPath = applicationDirPath + "/../lib/" + pluginsSubDir;
QStringList PluginsPath;
// NOTE: not the best solution but for now this is
// on make install [PREFIX]/bin and [PREFIX]/lib/sdrangel
PluginsPath << applicationDirPath + "/../lib/sdrangel/" + pluginsSubDir;
// on build
PluginsPath << applicationDirPath + "/lib/" + pluginsSubDir;
#ifdef __APPLE__
applicationLibPath.clear();
applicationLibPath.append(applicationDirPath + "/../Frameworks/" + pluginsSubDir);
// on SDRAngel.app
PluginsPath << applicationDirPath + "/../Frameworks/" + pluginsSubDir;
#endif
QString applicationBuildPath = applicationDirPath + "/" + pluginsSubDir;
qDebug() << "PluginManager::loadPlugins: " << qPrintable(applicationLibPath) << "," << qPrintable(applicationBuildPath);
QDir pluginsLibDir = QDir(applicationLibPath);
QDir pluginsBuildDir = QDir(applicationBuildPath);
// NOTE: exit on the first folder found
bool found = false;
foreach (QString dir, PluginsPath)
{
QDir d(dir);
if (d.isEmpty()) {
qDebug("PluginManager::loadPluginsPart folder %s is empty", qPrintable(dir));
continue;
}
loadPluginsDir(pluginsLibDir);
loadPluginsDir(pluginsBuildDir);
found = true;
loadPluginsDir(d);
break;
}
if (!found)
{
qCritical("No plugins found. Exit immediately.");
exit(EXIT_FAILURE);
}
}
void PluginManager::loadPluginsFinal()
@ -133,83 +152,72 @@ void PluginManager::loadPluginsDir(const QDir& dir)
{
QDir pluginsDir(dir);
foreach (QString fileName, pluginsDir.entryList(QDir::Files))
{
if (fileName.endsWith(".so") || fileName.endsWith(".dll") || fileName.endsWith(".dylib"))
{
qDebug() << "PluginManager::loadPluginsDir: fileName: " << qPrintable(fileName);
foreach (QString fileName, pluginsDir.entryList(QDir::Files))
{
if (QLibrary::isLibrary(fileName))
{
qDebug("PluginManager::loadPluginsDir: fileName: %s", qPrintable(fileName));
QPluginLoader* loader = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
PluginInterface* plugin = qobject_cast<PluginInterface*>(loader->instance());
QPluginLoader* plugin = new QPluginLoader(pluginsDir.absoluteFilePath(fileName));
if (!plugin->load())
{
qWarning("PluginManager::loadPluginsDir: %s", qPrintable(plugin->errorString()));
delete plugin;
continue;
}
if (loader->isLoaded())
{
qInfo("PluginManager::loadPluginsDir: loaded plugin %s", qPrintable(fileName));
}
else
{
qWarning() << "PluginManager::loadPluginsDir: " << qPrintable(loader->errorString());
}
PluginInterface* instance = qobject_cast<PluginInterface*>(plugin->instance());
if (instance == nullptr)
{
qWarning("PluginManager::loadPluginsDir: Unable to get main instance of plugin: %s", qPrintable(fileName) );
delete plugin;
continue;
}
if (plugin != 0)
{
m_plugins.append(Plugin(fileName, loader, plugin));
}
else
{
loader->unload();
}
delete loader; // Valgrind memcheck
}
}
// recursive calls on subdirectories
foreach (QString dirName, pluginsDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot))
{
loadPluginsDir(pluginsDir.absoluteFilePath(dirName));
}
qInfo("PluginManager::loadPluginsDir: loaded plugin %s", qPrintable(fileName));
m_plugins.append(Plugin(fileName, plugin, instance));
}
}
}
void PluginManager::listTxChannels(QList<QString>& list)
{
list.clear();
list.clear();
for(PluginAPI::ChannelRegistrations::iterator it = m_txChannelRegistrations.begin(); it != m_txChannelRegistrations.end(); ++it)
for(PluginAPI::ChannelRegistrations::iterator it = m_txChannelRegistrations.begin(); it != m_txChannelRegistrations.end(); ++it)
{
const PluginDescriptor& pluginDescipror = it->m_plugin->getPluginDescriptor();
list.append(pluginDescipror.displayedName);
const PluginDescriptor& pluginDescipror = it->m_plugin->getPluginDescriptor();
list.append(pluginDescipror.displayedName);
}
}
void PluginManager::listRxChannels(QList<QString>& list)
{
list.clear();
list.clear();
for(PluginAPI::ChannelRegistrations::iterator it = m_rxChannelRegistrations.begin(); it != m_rxChannelRegistrations.end(); ++it)
for(PluginAPI::ChannelRegistrations::iterator it = m_rxChannelRegistrations.begin(); it != m_rxChannelRegistrations.end(); ++it)
{
const PluginDescriptor& pluginDesciptor = it->m_plugin->getPluginDescriptor();
list.append(pluginDesciptor.displayedName);
const PluginDescriptor& pluginDesciptor = it->m_plugin->getPluginDescriptor();
list.append(pluginDesciptor.displayedName);
}
}
void PluginManager::createRxChannelInstance(int channelPluginIndex, DeviceUISet *deviceUISet, DeviceAPI *deviceAPI)
{
if (channelPluginIndex < m_rxChannelRegistrations.size())
if (channelPluginIndex < m_rxChannelRegistrations.size())
{
PluginInterface *pluginInterface = m_rxChannelRegistrations[channelPluginIndex].m_plugin;
BasebandSampleSink *rxChannel = pluginInterface->createRxChannelBS(deviceAPI);
pluginInterface->createRxChannelGUI(deviceUISet, rxChannel);
PluginInterface *pluginInterface = m_rxChannelRegistrations[channelPluginIndex].m_plugin;
BasebandSampleSink *rxChannel = pluginInterface->createRxChannelBS(deviceAPI);
pluginInterface->createRxChannelGUI(deviceUISet, rxChannel);
}
}
void PluginManager::createTxChannelInstance(int channelPluginIndex, DeviceUISet *deviceUISet, DeviceAPI *deviceAPI)
{
if (channelPluginIndex < m_txChannelRegistrations.size())
if (channelPluginIndex < m_txChannelRegistrations.size())
{
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
BasebandSampleSource *txChannel = pluginInterface->createTxChannelBS(deviceAPI);
pluginInterface->createTxChannelGUI(deviceUISet, txChannel);
PluginInterface *pluginInterface = m_txChannelRegistrations[channelPluginIndex].m_plugin;
BasebandSampleSource *txChannel = pluginInterface->createTxChannelBS(deviceAPI);
pluginInterface->createTxChannelGUI(deviceUISet, txChannel);
}
}