From 5ca34cde11574f25857497f3fe40d6dafe2fbda4 Mon Sep 17 00:00:00 2001 From: Daan Wijffels Date: Thu, 9 Jan 2025 14:24:38 +0000 Subject: [PATCH] Only depend on gtest when testing --- diagnostic_remote_logging/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/diagnostic_remote_logging/CMakeLists.txt b/diagnostic_remote_logging/CMakeLists.txt index f646b4e8..67a9f876 100644 --- a/diagnostic_remote_logging/CMakeLists.txt +++ b/diagnostic_remote_logging/CMakeLists.txt @@ -10,7 +10,6 @@ set(dependencies rclcpp rclcpp_components diagnostic_msgs - ament_cmake_gtest CURL ) @@ -46,10 +45,11 @@ install(TARGETS influx_component ) if(BUILD_TESTING) - ament_add_gtest(unit_tests test/influx_line_protocol.cpp) - target_include_directories(unit_tests PRIVATE include) - target_link_libraries(unit_tests influx_component) - ament_target_dependencies(unit_tests ${dependencies}) + find_package(ament_cmake_gtest REQUIRED) + ament_add_gtest(unit_tests test/influx_line_protocol.cpp) + target_include_directories(unit_tests PRIVATE include) + target_link_libraries(unit_tests influx_component) + ament_target_dependencies(unit_tests ${dependencies} ament_cmake_gtest) endif()