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