Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit afe5fae

Browse files
committedAug 23, 2023
#197 - add sources and dependencies arguments to generate_dynamic_reconfigure_options
1 parent 2654f22 commit afe5fae

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed
 

‎CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Changelog for package dynamic_reconfigure
33
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44

5+
Forthcoming
6+
-----------
7+
* add sources and dependencies arguments to generate_dynamic_reconfigure_options (`#197 <https://github.com/ros/dynamic_reconfigure/issues/197>`_)
8+
* Contributors: Boyan Hristov
9+
510
1.7.3 (2022-05-05)
611
------------------
712
* Add Loader=yaml.Loader to yaml.load (`#178 <https://github.com/ros/dynamic_reconfigure/issues/178>`_)

‎cmake/dynamic_reconfigure-macros.cmake

+19-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,24 @@ macro(generate_dynamic_reconfigure_options)
66
# ensure that package destination variables are defined
77
catkin_destinations()
88

9+
_generate_dynamic_reconfigure_options(${ARGN})
10+
endmacro()
11+
12+
function(_generate_dynamic_reconfigure_options)
13+
# parse arguments
14+
cmake_parse_arguments(ARG "" "" "SOURCES;DEPENDENCIES" ${ARGN})
15+
16+
# backwards compatibility with old interface,
17+
# i.e. the passed arguments are a list of sources
18+
if (NOT ARG_SOURCES AND NOT ARG_DEPENDENCIES)
19+
set(ARG_SOURCES ${ARGN})
20+
set(ARG_DEPENDENCIES "")
21+
elseif(NOT ARG_SOURCES)
22+
message(FATAL_ERROR "generate_dynamic_reconfigure_options() called with DEPENDENCIES but no SOURCES argument.")
23+
endif()
24+
925
set(_autogen "")
10-
foreach(_cfg ${ARGN})
26+
foreach(_cfg ${ARG_SOURCES})
1127
# Construct the path to the .cfg file
1228
set(_input ${_cfg})
1329
if(NOT IS_ABSOLUTE ${_input})
@@ -68,7 +84,7 @@ macro(generate_dynamic_reconfigure_options)
6884
add_custom_command(OUTPUT
6985
${_output_cpp} ${_output_dox} ${_output_usage} ${_output_py} ${_output_wikidoc}
7086
COMMAND ${_cmd}
71-
DEPENDS ${_input} ${gencfg_build_files}
87+
DEPENDS ${_input} ${gencfg_build_files} ${ARG_DEPENDENCIES}
7288
COMMENT "Generating dynamic reconfigure files from ${_cfg}: ${_output_cpp} ${_output_py}"
7389
)
7490

@@ -87,7 +103,7 @@ macro(generate_dynamic_reconfigure_options)
87103
list(APPEND ${PROJECT_NAME}_EXPORTED_TARGETS ${PROJECT_NAME}_gencfg)
88104

89105
dynreconf_called()
90-
endmacro()
106+
endfunction()
91107

92108
macro(dynreconf_called)
93109
if(NOT dynamic_reconfigure_CALLED)

0 commit comments

Comments
 (0)
Please sign in to comment.