Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#197 - add sources and dependencies arguments to generate_dynamic_reconfigure_options #198

Draft
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog for package dynamic_reconfigure
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Forthcoming
-----------
* add sources and dependencies arguments to generate_dynamic_reconfigure_options (`#197 <https://github.com/ros/dynamic_reconfigure/issues/197>`_)
* Contributors: Boyan Hristov

1.7.3 (2022-05-05)
------------------
* Add Loader=yaml.Loader to yaml.load (`#178 <https://github.com/ros/dynamic_reconfigure/issues/178>`_)
Expand Down
21 changes: 18 additions & 3 deletions cmake/dynamic_reconfigure-macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,23 @@ macro(generate_dynamic_reconfigure_options)
# ensure that package destination variables are defined
catkin_destinations()

_generate_dynamic_reconfigure_options(${ARGN})
endmacro()

function(_generate_dynamic_reconfigure_options)
cmake_parse_arguments(ARG "" "" "SOURCES;DEPENDENCIES" ${ARGN})

# backwards compatibility with old interface,
# i.e. the passed arguments are a list of sources
if (NOT ARG_SOURCES AND NOT ARG_DEPENDENCIES)
set(ARG_SOURCES ${ARGN})
set(ARG_DEPENDENCIES "")
elseif(NOT ARG_SOURCES)
message(FATAL_ERROR "generate_dynamic_reconfigure_options() called with DEPENDENCIES but no SOURCES argument.")
endif()

set(_autogen "")
foreach(_cfg ${ARGN})
foreach(_cfg ${ARG_SOURCES})
# Construct the path to the .cfg file
set(_input ${_cfg})
if(NOT IS_ABSOLUTE ${_input})
Expand Down Expand Up @@ -68,7 +83,7 @@ macro(generate_dynamic_reconfigure_options)
add_custom_command(OUTPUT
${_output_cpp} ${_output_dox} ${_output_usage} ${_output_py} ${_output_wikidoc}
COMMAND ${_cmd}
DEPENDS ${_input} ${gencfg_build_files}
DEPENDS ${_input} ${gencfg_build_files} ${ARG_DEPENDENCIES}
COMMENT "Generating dynamic reconfigure files from ${_cfg}: ${_output_cpp} ${_output_py}"
)

Expand All @@ -87,7 +102,7 @@ macro(generate_dynamic_reconfigure_options)
list(APPEND ${PROJECT_NAME}_EXPORTED_TARGETS ${PROJECT_NAME}_gencfg)

dynreconf_called()
endmacro()
endfunction()

macro(dynreconf_called)
if(NOT dynamic_reconfigure_CALLED)
Expand Down