To answer your question in the comment, you can use ament_target_dependencies to link against other ament packages (for example). But if you are linking against a target in the same project, there's no ament command that I am aware of. target_link_libraries is the way to do it (as you have done in your posted cmake code).