Skip to content

Commit

Permalink
Move visibility header generation to generated_headers block.
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanFabian authored Jun 21, 2023
1 parent ff6cb18 commit cc0dcad
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ foreach(_abs_idl_file ${rosidl_generate_interfaces_ABS_IDL_FILES})
)
endforeach()

# generate header to switch between export and import for a specific package
set(_visibility_control_file
"${_output_path}/msg/rosidl_generator_cpp__visibility_control.hpp")
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
configure_file(
"${rosidl_generator_cpp_TEMPLATE_DIR}/rosidl_generator_cpp__visibility_control.hpp.in"
"${_visibility_control_file}"
@ONLY
)
list(APPEND _generated_headers "${_visibility_control_file}")

set(_dependency_files "")
set(_dependencies "")
foreach(_pkg_name ${rosidl_generate_interfaces_DEPENDENCY_PACKAGE_NAMES})
Expand Down Expand Up @@ -95,18 +106,6 @@ add_custom_command(
VERBATIM
)

# generate header to switch between export and import for a specific package
set(_visibility_control_file
"${_output_path}/msg/rosidl_generator_cpp__visibility_control.hpp")
string(TOUPPER "${PROJECT_NAME}" PROJECT_NAME_UPPER)
configure_file(
"${rosidl_generator_cpp_TEMPLATE_DIR}/rosidl_generator_cpp__visibility_control.hpp.in"
"${_visibility_control_file}"
@ONLY
)
list(APPEND _generated_headers "${_visibility_control_file}")


# INTERFACE libraries can't have file-level dependencies in CMake,
# so make a custom target depending on the generated files
# TODO(sloretz) make this target name less generic than "__cpp" when other
Expand Down

0 comments on commit cc0dcad

Please sign in to comment.