From 26fbe9ae887a5096e2d55ba2af09864c08944124 Mon Sep 17 00:00:00 2001 From: Ionut Muthi Date: Tue, 28 May 2024 08:23:15 +0300 Subject: [PATCH] generic: plugins CMAKE variables Signed-off-by: Ionut Muthi --- plugins/CMakeLists.txt | 45 +++++++------------ plugins/adc/CMakeLists.txt | 10 ++++- plugins/datalogger/CMakeLists.txt | 10 ++++- plugins/debugger/CMakeLists.txt | 9 +++- plugins/m2k/CMakeLists.txt | 10 ++++- plugins/pqm/CMakeLists.txt | 9 +++- plugins/regmap/CMakeLists.txt | 2 +- .../regmap/scopy-regmap_config.h.cmakein | 2 +- plugins/swiot/CMakeLists.txt | 10 ++++- 9 files changed, 63 insertions(+), 44 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index d9d065c23b..6b606b6b6a 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -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 @@ -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) @@ -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) @@ -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}) diff --git a/plugins/adc/CMakeLists.txt b/plugins/adc/CMakeLists.txt index 493c17e05c..15f382140d 100644 --- a/plugins/adc/CMakeLists.txt +++ b/plugins/adc/CMakeLists.txt @@ -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 @@ -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}) diff --git a/plugins/datalogger/CMakeLists.txt b/plugins/datalogger/CMakeLists.txt index e3217ef094..b4c7ef0b8e 100644 --- a/plugins/datalogger/CMakeLists.txt +++ b/plugins/datalogger/CMakeLists.txt @@ -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 @@ -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}) diff --git a/plugins/debugger/CMakeLists.txt b/plugins/debugger/CMakeLists.txt index 4f599f4376..3a98ec4579 100644 --- a/plugins/debugger/CMakeLists.txt +++ b/plugins/debugger/CMakeLists.txt @@ -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 @@ -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) diff --git a/plugins/m2k/CMakeLists.txt b/plugins/m2k/CMakeLists.txt index 76b8eae89a..d95a601670 100644 --- a/plugins/m2k/CMakeLists.txt +++ b/plugins/m2k/CMakeLists.txt @@ -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) @@ -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) diff --git a/plugins/pqm/CMakeLists.txt b/plugins/pqm/CMakeLists.txt index 03af147e61..c4dfd5ec0f 100644 --- a/plugins/pqm/CMakeLists.txt +++ b/plugins/pqm/CMakeLists.txt @@ -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 @@ -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}) diff --git a/plugins/regmap/CMakeLists.txt b/plugins/regmap/CMakeLists.txt index 64942077d1..dfa7bb94d7 100644 --- a/plugins/regmap/CMakeLists.txt +++ b/plugins/regmap/CMakeLists.txt @@ -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) diff --git a/plugins/regmap/include/regmap/scopy-regmap_config.h.cmakein b/plugins/regmap/include/regmap/scopy-regmap_config.h.cmakein index a82e39a417..b9797d5ad1 100644 --- a/plugins/regmap/include/regmap/scopy-regmap_config.h.cmakein +++ b/plugins/regmap/include/regmap/scopy-regmap_config.h.cmakein @@ -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@" diff --git a/plugins/swiot/CMakeLists.txt b/plugins/swiot/CMakeLists.txt index 4d7e23abf1..d1532d5a8e 100644 --- a/plugins/swiot/CMakeLists.txt +++ b/plugins/swiot/CMakeLists.txt @@ -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 @@ -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) +