Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate ament_target_dependencies() #572

Draft
wants to merge 2 commits into
base: rolling
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,30 @@ function(ament_target_dependencies target)
endif()
set(optional_keyword PUBLIC)
endif()

# Collect targets to use in deprecation warning
set(upstream_targets_for_deprecation_warning "")
foreach(package_name ${ARG_UNPARSED_ARGUMENTS})
foreach(_target IN LISTS ${package_name}_TARGETS)
if(TARGET ${_target})
if(_target MATCHES "(.+)::.+__rosidl_.+")
# suggest ${package_name_TARGETS} for message packages
list_append_unique(upstream_targets_for_deprecation_warning "\${${CMAKE_MATCH_1}_TARGETS}")
else()
list_append_unique(upstream_targets_for_deprecation_warning ${_target})
endif()
endif()
endforeach()
endforeach()
list(SORT upstream_targets_for_deprecation_warning)
list(JOIN upstream_targets_for_deprecation_warning "\n " upstream_targets_for_deprecation_warning)
message(DEPRECATION "ament_target_dependencies() is deprecated. "
"Use target_link_libraries() with modern CMake targets instead. "
"Try replacing this call with:\n"
" target_link_libraries(${target} ${required_keyword}\n"
" ${upstream_targets_for_deprecation_warning}\n"
" )\n")

set(definitions "")
set(include_dirs "")
set(interfaces "")
Expand Down