Skip to content

Commit 6d776cd

Browse files
authored
Remove the last uses of ament_target_dependencies in this repo. (#102)
While we are here, remove unnecessary exports of dependencies to downstream packages. With the one exception of rcl_logging_interface, all of the packages in here are implementation-only, so they should never need to export dependencies downstream. Signed-off-by: Chris Lalancette <[email protected]>
1 parent e9f237d commit 6d776cd

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

rcl_logging_interface/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ add_library(${PROJECT_NAME} ${${PROJECT_NAME}_sources})
2626
target_include_directories(${PROJECT_NAME} PUBLIC
2727
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
2828
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
29-
ament_target_dependencies(${PROJECT_NAME} rcutils)
29+
target_link_libraries(${PROJECT_NAME} PUBLIC rcutils::rcutils)
3030
target_compile_definitions(${PROJECT_NAME} PRIVATE "RCL_LOGGING_INTERFACE_BUILDING_DLL")
3131

3232
install(
@@ -54,8 +54,7 @@ if(BUILD_TESTING)
5454
find_package(rcpputils REQUIRED)
5555
ament_add_gtest(test_get_logging_directory test/test_get_logging_directory.cpp)
5656
if(TARGET test_get_logging_directory)
57-
target_link_libraries(test_get_logging_directory ${PROJECT_NAME})
58-
ament_target_dependencies(test_get_logging_directory rcutils rcpputils)
57+
target_link_libraries(test_get_logging_directory ${PROJECT_NAME} rcpputils::rcpputils rcutils::rcutils)
5958
endif()
6059
endif()
6160

rcl_logging_noop/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
4444
RUNTIME DESTINATION bin)
4545

4646

47-
# Export rcl_logging_interface to give downstream packages access to it's headers
48-
ament_export_dependencies(rcl_logging_interface)
4947
ament_export_libraries(${PROJECT_NAME})
5048
ament_export_targets(${PROJECT_NAME})
5149
ament_package()

rcl_logging_spdlog/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,15 @@ if(BUILD_TESTING)
5959
find_package(ament_cmake_gtest REQUIRED)
6060
ament_add_gmock(test_logging_interface test/test_logging_interface.cpp)
6161
if(TARGET test_logging_interface)
62-
target_link_libraries(test_logging_interface ${PROJECT_NAME})
62+
target_link_libraries(test_logging_interface ${PROJECT_NAME} rcpputils::rcpputils)
6363
target_compile_definitions(test_logging_interface PUBLIC RCUTILS_ENABLE_FAULT_INJECTION)
64-
ament_target_dependencies(test_logging_interface rcpputils)
6564
endif()
6665
add_performance_test(benchmark_logging_interface test/benchmark/benchmark_logging_interface.cpp)
6766
if(TARGET benchmark_logging_interface)
6867
target_link_libraries(benchmark_logging_interface ${PROJECT_NAME})
6968
endif()
7069
endif()
7170

72-
ament_export_dependencies(rcl_logging_interface)
73-
ament_export_dependencies(rcpputils)
74-
ament_export_dependencies(rcutils)
75-
ament_export_dependencies(spdlog_vendor)
76-
ament_export_dependencies(spdlog)
7771
ament_export_libraries(${PROJECT_NAME})
7872
ament_export_targets(${PROJECT_NAME})
7973
ament_package()

0 commit comments

Comments
 (0)