Skip to content

Commit

Permalink
feat: Add plugin targets to CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
pbosetti committed Jun 27, 2024
1 parent 7b9d5ef commit 9a5972c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
20 changes: 8 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,18 @@ include_directories(${gcem_SOURCE_DIR}/include)
include_directories(${stats_SOURCE_DIR}/include)
include_directories(${eigen_SOURCE_DIR})

# TARGETS ######################################################################
add_plugin(echoj)
add_plugin(clock)
add_plugin(to_console)
add_plugin(random)
add_plugin(running_avg)
if(NOT WIN32 AND NOT MADS_NO_DEPS_ONLY)
# Serial port plugin is not supported on Windows
add_plugin(serial_reader SRCS ${SRC_DIR}/serialport.cpp)
add_plugin(mqtt LIBS mosquittopp)
endif()

add_loader(load_filter)
add_loader(load_source)
add_loader(load_sink)

# These plugins are always build and use for testing
add_plugin(echoj)
add_plugin(clock)

# DO NOT ADD PLUGINS HERE; USE add_plugin() MACRO IN THE
# src/plugin/CMakeLists.txt FILE INSTEAD
include_directories(${SRC_DIR}/plugin)


# INSTALL ######################################################################
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
Expand Down
35 changes: 35 additions & 0 deletions src/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ____ _ _ _ _
# | _ \| |_ _ __ _(_)_ __ | |_ __ _ _ __ __ _ ___| |_ ___
# | |_) | | | | |/ _` | | '_ \ | __/ _` | '__/ _` |/ _ \ __/ __|
# | __/| | |_| | (_| | | | | | | || (_| | | | (_| | __/ |_\__ \
# |_| |_|\__,_|\__, |_|_| |_| \__\__,_|_| \__, |\___|\__|___/
# |___/ |___/

# Add plugin targets here
# Use the syntax:
# add_plugin(<plugin_name> [SRCS <source_files>] [LIBS <libraries>])
# If the plugin has only one source file, that is the plugin_name.cpp file,
# you can omit the SRCS argument:
# add_plugin(plugin_name)
# Use the SRCS argument to specify additional source files.
# Use the LIBS argument to specify additional libraries that the plugin
# depends on.

# PLUGINS ######################################################################
# These plugins are built unconditionally.

add_plugin(to_console)
add_plugin(random)
add_plugin(running_avg)


# CONDITIONAL PLUGINS ##########################################################
# These plugins are only built if the required dependencies are available.

if(NOT MADS_NO_DEPS_ONLY)
if(NOT WIN32)
# Serial port plugin is not supported on Windows
add_plugin(serial_reader SRCS ${SRC_DIR}/serialport.cpp)
endif()
add_plugin(mqtt LIBS mosquittopp)
endif()

0 comments on commit 9a5972c

Please sign in to comment.