set(BOOST_ROOT D:/01softInstall/opt_lib/boost_1_72_install)
find_package(Boost 1.72.0 REQUIRED COMPONENTS thread atomic system regex)
if(Boost_FOUND)
## 在win10平台 ros2 版本dashing中 message 打印信息编译报错,注意需要注释掉.
# message(Boost_INCLUDE_DIRS " ${Boost_INCLUDE_DIRS}")
# message(Boost_LIBRARY_DIRS " ${Boost_LIBRARY_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
endif()
add_executable(rosmsg_middleware src/main.cpp src/TcpServer.hpp)
target_link_libraries(rosmsg_middleware ${Boost_LIBRARIES})
#只能连接package找到的包.
ament_target_dependencies(rosmsg_middleware rclcpp std_msgs)
#ament_target_dependencies(rosmsg_middleware rclcpp std_msgs Boost)
find_package(Boost REQUIRED COMPONENTS system)
target_link_libraries(your_node ${PROJECT_NAME} ${Boost_LIBRARIES})
ament_export_dependencies(Boost)
ament_export_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})