diff --git a/rclcpp/CMakeLists.txt b/rclcpp/CMakeLists.txt index 4562375a15..1d646bc580 100644 --- a/rclcpp/CMakeLists.txt +++ b/rclcpp/CMakeLists.txt @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.5) project(rclcpp) +find_package(Threads REQUIRED) + find_package(ament_cmake_ros REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(libstatistics_collector REQUIRED) @@ -166,6 +168,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC "$" "$" "$") +target_link_libraries(${PROJECT_NAME} ${CMAKE_THREAD_LIBS_INIT}) # specific order: dependents before dependencies ament_target_dependencies(${PROJECT_NAME} "libstatistics_collector"