micro-ROS / system_modes

System modes for ROS 2 and micro-ROS
Apache License 2.0
43 stars 9 forks source link

Use ament_target_dependencies to link boost_program_options #17

Closed cottsay closed 4 years ago

cottsay commented 4 years ago

find_package(Boost) may pass file paths for Boost libraries which may not be present in the default search locations at link time, so target_link_libraries(... boost_program_options) may not always work.

Since FindBoost.cmake sets Boost_<C>_FOUND and Boost_<C>_LIBRARIES for each requested component, we can let ament_target_dependencies() discover the component as if it were a standalone package.

https://github.com/Kitware/CMake/blob/efa30023b4056a4c17e80d7a86bc2506660c68a7/Modules/FindBoost.cmake#L30-L32

norro commented 4 years ago

LGTM, thanks!