Ask Your Question

ament_target_dependencies vs target_link_libraries

asked 2020-06-28 23:11:37 -0600

Rufus gravatar image

In the tutorial for adding dependencies, it mentions

Sometimes it will be necessary to call the target_link_libaries CMake function

What are the situations where I should use ament_target_dependencies and when should I use target_link_libraries? I also notice that there are occasions where I need both for the dependencies to be correctly added.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-02-12 05:21:33 -0600

Rufus gravatar image

From my understanding and a bit of experimentation, ament_target_dependencies only works for packages* found using find_package. For packages that aren't coming from find_package, e.g. locally compiled libraries in the same package, you will need to use target_link_libraries. See this question for more details.

* Not sure if it's only for ROS packages found with find_package, or if it works for any package found that way.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2020-06-28 23:11:37 -0600

Seen: 332 times

Last updated: Feb 12