diff --git a/ros2lifecycle_test_fixtures/CMakeLists.txt b/ros2lifecycle_test_fixtures/CMakeLists.txt index 1c3687838..787aff04e 100644 --- a/ros2lifecycle_test_fixtures/CMakeLists.txt +++ b/ros2lifecycle_test_fixtures/CMakeLists.txt @@ -19,8 +19,8 @@ find_package(rclcpp REQUIRED) add_executable(simple_lifecycle_node src/simple_lifecycle_node.cpp) -ament_target_dependencies(simple_lifecycle_node - "rclcpp_lifecycle") +target_link_libraries(simple_lifecycle_node PRIVATE + rclcpp_lifecycle::rclcpp_lifecycle) install(TARGETS simple_lifecycle_node diff --git a/ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em b/ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em index d49d6bf2f..43ab8136b 100644 --- a/ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em +++ b/ros2pkg/ros2pkg/resource/ament_cmake/CMakeLists.txt.em @@ -28,10 +28,10 @@ target_include_directories(@(cpp_library_name) PUBLIC $ $) @[ if dependencies]@ -ament_target_dependencies( - @(cpp_library_name) +target_link_libraries( + @(cpp_library_name) PUBLIC @[ for dep in dependencies]@ - "@(dep)" + ${@(dep)_TARGETS} @[ end for]@ ) @[ end if]@ @@ -63,10 +63,10 @@ target_link_libraries(@(cpp_node_name) @(cpp_library_name)) @[ else]@ target_compile_features(@(cpp_node_name) PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 @[ if dependencies]@ -ament_target_dependencies( +target_link_libraries( @(cpp_node_name) @[ for dep in dependencies]@ - "@(dep)" + ${@(dep)_TARGETS} @[ end for]@ ) @[ end if]@