Only target tracetools transitively for tracetools_test tests

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-03-08 23:36:58 -04:00
parent 8bf8255b02
commit cb149f8bc0

View file

@ -26,10 +26,10 @@ endif()
# Tests # Tests
if(BUILD_TESTING) if(BUILD_TESTING)
# tracetools is exported by rclcpp
find_package(rclcpp REQUIRED) find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED) find_package(std_msgs REQUIRED)
find_package(std_srvs REQUIRED) find_package(std_srvs REQUIRED)
find_package(tracetools REQUIRED)
add_executable(test_publisher add_executable(test_publisher
src/test_publisher.cpp src/test_publisher.cpp
@ -37,7 +37,6 @@ if(BUILD_TESTING)
ament_target_dependencies(test_publisher ament_target_dependencies(test_publisher
rclcpp rclcpp
std_msgs std_msgs
tracetools
) )
add_executable(test_intra add_executable(test_intra
src/test_intra.cpp src/test_intra.cpp
@ -45,7 +44,6 @@ if(BUILD_TESTING)
ament_target_dependencies(test_intra ament_target_dependencies(test_intra
rclcpp rclcpp
std_msgs std_msgs
tracetools
) )
add_executable(test_ping add_executable(test_ping
src/test_ping.cpp src/test_ping.cpp
@ -53,7 +51,6 @@ if(BUILD_TESTING)
ament_target_dependencies(test_ping ament_target_dependencies(test_ping
rclcpp rclcpp
std_msgs std_msgs
tracetools
) )
add_executable(test_pong add_executable(test_pong
src/test_pong.cpp src/test_pong.cpp
@ -61,14 +58,12 @@ if(BUILD_TESTING)
ament_target_dependencies(test_pong ament_target_dependencies(test_pong
rclcpp rclcpp
std_msgs std_msgs
tracetools
) )
add_executable(test_timer add_executable(test_timer
src/test_timer.cpp src/test_timer.cpp
) )
ament_target_dependencies(test_timer ament_target_dependencies(test_timer
rclcpp rclcpp
tracetools
) )
add_executable(test_service_ping add_executable(test_service_ping
src/test_service_ping.cpp src/test_service_ping.cpp
@ -76,7 +71,6 @@ if(BUILD_TESTING)
ament_target_dependencies(test_service_ping ament_target_dependencies(test_service_ping
rclcpp rclcpp
std_srvs std_srvs
tracetools
) )
add_executable(test_service_pong add_executable(test_service_pong
src/test_service_pong.cpp src/test_service_pong.cpp
@ -84,7 +78,6 @@ if(BUILD_TESTING)
ament_target_dependencies(test_service_pong ament_target_dependencies(test_service_pong
rclcpp rclcpp
std_srvs std_srvs
tracetools
) )
install(TARGETS install(TARGETS
@ -103,6 +96,7 @@ if(BUILD_TESTING)
# Only build tracing tests if LTTng is enabled and found # Only build tracing tests if LTTng is enabled and found
if(TRACING_ENABLED) if(TRACING_ENABLED)
find_package(tracetools REQUIRED)
find_package(ament_cmake_gtest REQUIRED) find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(test_utils test/test_utils.cpp) ament_add_gtest(test_utils test/test_utils.cpp)
if(TARGET test_utils) if(TARGET test_utils)