@@ -6,8 +6,23 @@ macro(generate_dynamic_reconfigure_options)
6
6
# ensure that package destination variables are defined
7
7
catkin_destinations()
8
8
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
+
9
24
set (_autogen "" )
10
- foreach (_cfg ${ARGN } )
25
+ foreach (_cfg ${ARG_SOURCES } )
11
26
# Construct the path to the .cfg file
12
27
set (_input ${_cfg} )
13
28
if (NOT IS_ABSOLUTE ${_input} )
@@ -68,7 +83,7 @@ macro(generate_dynamic_reconfigure_options)
68
83
add_custom_command (OUTPUT
69
84
${_output_cpp} ${_output_dox} ${_output_usage} ${_output_py} ${_output_wikidoc}
70
85
COMMAND ${_cmd}
71
- DEPENDS ${_input} ${gencfg_build_files}
86
+ DEPENDS ${_input} ${gencfg_build_files} ${ARG_DEPENDENCIES}
72
87
COMMENT "Generating dynamic reconfigure files from ${_cfg} : ${_output_cpp} ${_output_py} "
73
88
)
74
89
@@ -87,7 +102,7 @@ macro(generate_dynamic_reconfigure_options)
87
102
list (APPEND ${PROJECT_NAME} _EXPORTED_TARGETS ${PROJECT_NAME} _gencfg)
88
103
89
104
dynreconf_called()
90
- endmacro ()
105
+ endfunction ()
91
106
92
107
macro (dynreconf_called)
93
108
if (NOT dynamic_reconfigure_CALLED)
0 commit comments