Skip to content

Commit 7b94da9

Browse files
committed
#197 - add sources and dependencies arguments to generate_dynamic_reconfigure_options
1 parent 2654f22 commit 7b94da9

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-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

+18-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,23 @@ 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+
cmake_parse_arguments(ARG "" "" "SOURCES;DEPENDENCIES" ${ARGN})
14+
15+
# backwards compatibility with old interface,
16+
# i.e. the passed arguments are a list of sources
17+
if (NOT ARG_SOURCES AND NOT ARG_DEPENDENCIES)
18+
set(ARG_SOURCES ${ARGN})
19+
set(ARG_DEPENDENCIES "")
20+
elseif(NOT ARG_SOURCES)
21+
message(FATAL_ERROR "generate_dynamic_reconfigure_options() called with DEPENDENCIES but no SOURCES argument.")
22+
endif()
23+
924
set(_autogen "")
10-
foreach(_cfg ${ARGN})
25+
foreach(_cfg ${ARG_SOURCES})
1126
# Construct the path to the .cfg file
1227
set(_input ${_cfg})
1328
if(NOT IS_ABSOLUTE ${_input})
@@ -68,7 +83,7 @@ macro(generate_dynamic_reconfigure_options)
6883
add_custom_command(OUTPUT
6984
${_output_cpp} ${_output_dox} ${_output_usage} ${_output_py} ${_output_wikidoc}
7085
COMMAND ${_cmd}
71-
DEPENDS ${_input} ${gencfg_build_files}
86+
DEPENDS ${_input} ${gencfg_build_files} ${ARG_DEPENDENCIES}
7287
COMMENT "Generating dynamic reconfigure files from ${_cfg}: ${_output_cpp} ${_output_py}"
7388
)
7489

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

89104
dynreconf_called()
90-
endmacro()
105+
endfunction()
91106

92107
macro(dynreconf_called)
93108
if(NOT dynamic_reconfigure_CALLED)

0 commit comments

Comments
 (0)