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 12, 2024
1 parent e54301a commit a8188bd
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 43 deletions.
47 changes: 18 additions & 29 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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})
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 @@ -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})
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 @@ -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})
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 @@ -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)
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 @@ -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)
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 @@ -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})
2 changes: 1 addition & 1 deletion plugins/regmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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 @@ -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)

0 comments on commit a8188bd

Please sign in to comment.