From a8188bde0086fd2ce29539855edc84e453b7404d 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 | 47 +++++++------------ 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, 66 insertions(+), 43 deletions(-) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 375ab64394..31f92b9891 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -17,6 +17,7 @@ option(ENABLE_PLUGIN_IIODEBUGPLUGIN "Enable IIODEBUGPLUGIN plugin" ON) set(PLUGIN_COMPONENTS "") set(PLUGIN_COMPONENTS_FILES "") +<<<<<<< HEAD if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SCOPY_PLUGIN_BUILD_PATH}) elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") @@ -27,10 +28,13 @@ endif() function(ConfigureInstallerSettings PLUGIN_NAME PLUGIN_DESCRIPTION FIXED) string(REPLACE "scopy-" "" AUX_PLUGIN ${PLUGIN_NAME}) +======= +function(ConfigureInstallerSettings PROJECT_NAME PLUGIN_NAME PLUGIN_DESCRIPTION FIXED) +>>>>>>> generic: plugins CMAKE variables 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 @@ -71,20 +75,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) @@ -95,20 +99,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) @@ -122,26 +126,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 e4cbb18a7f..0f530522d5 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 @@ -57,7 +61,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 1b5b21c3fc..de6b6ec03d 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 @@ -84,7 +88,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 778ab1d056..0b703df063 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 @@ -64,5 +67,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 e4a7689db1..095964941c 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) @@ -118,5 +122,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 074fa18fd1..007c0c1084 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 @@ -58,7 +61,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 a6b19f7580..128436d1af 100644 --- a/plugins/regmap/CMakeLists.txt +++ b/plugins/regmap/CMakeLists.txt @@ -107,5 +107,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 dec90042bc..a4a014b9a3 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 @@ -96,5 +99,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) +