Skip to content

Commit 187210e

Browse files
authored
Fixed visibility control file added to wrong header list variable. (#755)
* Fixed visibility control file added to wrong header list variable. * Move visibility header generation to generated_headers block. Signed-off-by: Stefan Fabian <[email protected]>
1 parent 69efae0 commit 187210e

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

rosidl_generator_cpp/cmake/rosidl_generator_cpp_generate_interfaces.cmake

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ foreach(_abs_idl_file ${rosidl_generate_interfaces_ABS_IDL_FILES})
3232
)
3333
endforeach()
3434

35+
# generate header to switch between export and import for a specific package
36+
set(_visibility_control_file
37+
"${_output_path}/msg/rosidl_generator_cpp__visibility_control.hpp")
38+
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
39+
configure_file(
40+
"${rosidl_generator_cpp_TEMPLATE_DIR}/rosidl_generator_cpp__visibility_control.hpp.in"
41+
"${_visibility_control_file}"
42+
@ONLY
43+
)
44+
list(APPEND _generated_headers "${_visibility_control_file}")
45+
3546
set(_dependency_files "")
3647
set(_dependencies "")
3748
foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
@@ -95,18 +106,6 @@ add_custom_command(
95106
VERBATIM
96107
)
97108

98-
# generate header to switch between export and import for a specific package
99-
set(_visibility_control_file
100-
"${_output_path}/msg/rosidl_generator_cpp__visibility_control.hpp")
101-
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
102-
configure_file(
103-
"${rosidl_generator_cpp_TEMPLATE_DIR}/rosidl_generator_cpp__visibility_control.hpp.in"
104-
"${_visibility_control_file}"
105-
@ONLY
106-
)
107-
list(APPEND _generated_msg_headers "${_visibility_control_file}")
108-
109-
110109
# INTERFACE libraries can't have file-level dependencies in CMake,
111110
# so make a custom target depending on the generated files
112111
# TODO(sloretz) make this target name less generic than "__cpp" when other

0 commit comments

Comments
 (0)