Skip to content

Commit

Permalink
generic: plugins CMAKE variables
Browse files Browse the repository at this point in the history
Signed-off-by: Ionut Muthi <[email protected]>
  • Loading branch information
IonutMuthi committed Jun 11, 2024
1 parent 55f8fcc commit 26fbe9a
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 44 deletions.
45 changes: 15 additions & 30 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ option(ENABLE_PLUGIN_IIODEBUGPLUGIN "Enable IIODEBUGPLUGIN plugin" ON)
set(PLUGIN_COMPONENTS "")
set(PLUGIN_COMPONENTS_FILES "")

function(ConfigureInstallerSettings PROJECT_NAME FIXED)
function(ConfigureInstallerSettings PROJECT_NAME PLUGIN_NAME PLUGIN_DESCRIPTION FIXED)

set(PLUGIN_COMPONENTS
${PLUGIN_COMPONENTS}
"\n Name: \"plugins/${PROJECT_NAME}\"; Description: ${ARGN} ; Types: full plugins; Flags: ${FIXED} "
"\n Name: \"plugins/${PROJECT_NAME}\"; Description: ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} ; Types: full plugins; Flags: ${FIXED} "
PARENT_SCOPE
)
set(PLUGIN_COMPONENTS_FILES
Expand Down Expand Up @@ -62,20 +62,20 @@ endif()

if(ENABLE_PLUGIN_ADC)
add_subdirectory(adc)
list(APPEND PLUGINS ${PLUGIN_NAME})
configureinstallersettings(${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
endif()

if(ENABLE_PLUGIN_REGMAP)
add_subdirectory(regmap)
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} "fixed" ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} )
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
endif()

if(ENABLE_PLUGIN_DEBUGGER)
add_subdirectory(debugger)
list(APPEND PLUGINS ${PLUGIN_NAME})
configureinstallersettings(${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
endif()

if(ENABLE_PLUGIN_IIODEBUGPLUGIN)
Expand All @@ -86,20 +86,20 @@ endif()

if(ENABLE_PLUGIN_DATALOGGER)
add_subdirectory(datalogger)
list(APPEND PLUGINS ${PLUGIN_NAME})
configureinstallersettings(${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "fixed")
endif()

if(ENABLE_PLUGIN_SWIOT)
add_subdirectory(swiot)
list(APPEND PLUGINS ${PLUGIN_NAME})
configureinstallersettings(${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "disablenouninstallwarning")
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "disablenouninstallwarning" )
endif()

if(ENABLE_PLUGIN_PQM)
add_subdirectory(pqm)
list(APPEND PLUGINS ${PLUGIN_NAME})
configureinstallersettings(${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "disablenouninstallwarning")
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "disablenouninstallwarning" )
endif()

if(ENABLE_PLUGIN_M2K)
Expand All @@ -113,26 +113,11 @@ if(ENABLE_PLUGIN_M2K)

if(WITH_SIGROK AND WITH_PYTHON)
add_subdirectory(m2k)
list(APPEND PLUGINS ${PLUGIN_NAME})
configureinstallersettings(${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "disablenouninstallwarning")
list(APPEND PLUGINS ${PROJECT_NAME})
configureinstallersettings(${PLUGIN_SHORT_NAME} ${PLUGIN_NAME} ${PLUGIN_DESCRIPTION} "disablenouninstallwarning")
endif()
endif()

if(ENABLE_PLUGIN_REGMAP)
add_subdirectory(regmap)
list(APPEND PLUGINS ${LIBRARY_NAME})
endif()

if(ENABLE_PLUGIN_DEBUGGER)
add_subdirectory(debugger)
list(APPEND PLUGINS ${PLUGIN_NAME})
endif()

if(ENABLE_PLUGIN_DATALOGGER)
add_subdirectory(datalogger)
list(APPEND PLUGINS ${PLUGIN_NAME})
endif()

if(ENABLE_PLUGIN_DATAMONITOR)
add_subdirectory(datamonitor)
list(APPEND PLUGINS ${PLUGIN_NAME})
Expand Down
10 changes: 8 additions & 2 deletions plugins/adc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

set(PLUGIN_NAME "ADC")
set(PLUGIN_DESCRIPTION "Analog to Digital Convertor")


include(GenerateExportHeader)

# TODO: split stylesheet/resources and add here TODO: export header files correctly
Expand Down Expand Up @@ -65,7 +69,9 @@ target_link_libraries(
scopy-iio-widgets
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION "ADC plugin" PARENT_SCOPE)
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)

install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${SCOPY_PLUGIN_INSTALL_DIR})
10 changes: 8 additions & 2 deletions plugins/datalogger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

set(PLUGIN_NAME "Data logger")
set(PLUGIN_DESCRIPTION "Used to monitor and log data")


include(GenerateExportHeader)

# TODO: split stylesheet/resources and add here TODO: export header files correctly
Expand Down Expand Up @@ -92,7 +96,9 @@ target_link_libraries(
scopy-iio-widgets
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION "Data Logger plugin" PARENT_SCOPE)
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)

install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${SCOPY_PLUGIN_INSTALL_DIR})
9 changes: 7 additions & 2 deletions plugins/debugger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

set(PLUGIN_NAME "Debuger")
set(PLUGIN_DESCRIPTION "Used to debug connected devices")

include(GenerateExportHeader)

# TODO: split stylesheet/resources and add here TODO: export header files correctly
Expand Down Expand Up @@ -72,5 +75,7 @@ target_link_libraries(
scopy-core
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION "Debugger plugin" PARENT_SCOPE)
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)
10 changes: 8 additions & 2 deletions plugins/m2k/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

set(PLUGIN_NAME "ADALM2000")
set(PLUGIN_DESCRIPTION "Plugin for ADALM2000 (M2K)")


include(GenerateExportHeader)

set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -126,5 +130,7 @@ target_link_libraries(
gnuradio::gnuradio-m2k
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION "ADALM2000 plugin" PARENT_SCOPE)
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)
9 changes: 7 additions & 2 deletions plugins/pqm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

set(PLUGIN_NAME "PQM")
set(PLUGIN_DESCRIPTION "Power Quality Monitor")

include(GenerateExportHeader)

# TODO: split stylesheet/resources and add here TODO: export header files correctly
Expand Down Expand Up @@ -66,7 +69,9 @@ target_link_libraries(
scopy-gr-util
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION "Power Quality Monitor plugin (PQM)" PARENT_SCOPE)
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)

install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${SCOPY_PLUGIN_INSTALL_DIR})
2 changes: 1 addition & 1 deletion plugins/regmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ target_link_libraries(
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION "Register map plugin" PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define REGMAP_XML_BUILD_PATH "@REGMAP_XML_BUILD_PATH@"


#define REGMAP_LIBRARY_NAME "@LIBRARY_NAME@"
#define REGMAP_PROJECT_NAME "@PROJECT_NAME@"
#define REGMAP_PLUGIN_NAME "@PLUGIN_NAME@"
#define REGMAP_PLUGIN_SHORT_NAME "@PLUGIN_SHORT_NAME@"
#define REGMAP_PLUGIN_DESCRIPTION "@PLUGIN_DESCRIPTION@"
Expand Down
10 changes: 8 additions & 2 deletions plugins/swiot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ message(STATUS "building plugin: " ${SCOPY_MODULE})

project(scopy-${SCOPY_MODULE} VERSION 0.1 LANGUAGES CXX)

set(PLUGIN_NAME "AD-SWIOT1L-SL")
set(PLUGIN_DESCRIPTION "Plugin for AD-SWIOT1L-SL")

include(GenerateExportHeader)

# TODO: split stylesheet/resources and add here TODO: export header files correctly
Expand Down Expand Up @@ -104,5 +107,8 @@ target_link_libraries(
scopy-iio-widgets
)

set(PLUGIN_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION " AD-SWIOT1L-SL plugin" PARENT_SCOPE)
set(PROJECT_NAME ${PROJECT_NAME} PARENT_SCOPE)
set(PLUGIN_NAME ${PLUGIN_NAME} PARENT_SCOPE)
set(PLUGIN_SHORT_NAME ${SCOPY_MODULE} PARENT_SCOPE)
set(PLUGIN_DESCRIPTION ${PLUGIN_DESCRIPTION} PARENT_SCOPE)

0 comments on commit 26fbe9a

Please sign in to comment.