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.
find_package(Boost)
may pass file paths for Boost libraries which may not be present in the default search locations at link time, sotarget_link_libraries(... boost_program_options)
may not always work.Since
FindBoost.cmake
setsBoost_<C>_FOUND
andBoost_<C>_LIBRARIES
for each requested component, we can letament_target_dependencies()
discover the component as if it were a standalone package.https://github.com/Kitware/CMake/blob/efa30023b4056a4c17e80d7a86bc2506660c68a7/Modules/FindBoost.cmake#L30-L32