@@ -11,54 +11,54 @@ find_package(btcpp_ros2_interfaces REQUIRED)
1111find_package (std_msgs REQUIRED)
1212find_package (std_srvs REQUIRED)
1313
14- set (THIS_PACKAGE_DEPS
15- behaviortree_ros2
16- std_msgs
17- std_srvs
18- btcpp_ros2_interfaces )
14+ set (THIS_PACKAGE_AMENT_TARGETS
15+ behaviortree_ros2::behaviortree_ros2
16+ ${std_msgs_TARGETS}
17+ ${std_srvs_TARGETS}
18+ ${btcpp_ros2_interfaces_TARGETS} )
1919
2020######################################################
2121# Simple example showing how to use and customize the BtExecutionServer
2222add_executable (sample_bt_executor src/sample_bt_executor.cpp)
23- ament_target_dependencies (sample_bt_executor ${THIS_PACKAGE_DEPS } )
23+ target_link_libraries (sample_bt_executor ${THIS_PACKAGE_AMENT_TARGETS } )
2424
2525######################################################
2626# Build an Action Client that calls the sleep action (STATIC version)
2727
2828add_executable (sleep_client
2929 src/sleep_action.cpp
3030 src/sleep_client.cpp)
31- ament_target_dependencies (sleep_client ${THIS_PACKAGE_DEPS } )
31+ target_link_libraries (sleep_client ${THIS_PACKAGE_AMENT_TARGETS } )
3232
3333######################################################
3434# Build a client that call the sleep action (Plugin version)
3535
3636add_library (sleep_plugin SHARED src/sleep_action.cpp)
3737target_compile_definitions (sleep_plugin PRIVATE BT_PLUGIN_EXPORT )
38- ament_target_dependencies (sleep_plugin ${THIS_PACKAGE_DEPS } )
38+ target_link_libraries (sleep_plugin ${THIS_PACKAGE_AMENT_TARGETS } )
3939
4040add_executable (sleep_client_dyn src/sleep_client.cpp)
4141target_compile_definitions (sleep_client_dyn PRIVATE USE_SLEEP_PLUGIN )
4242target_link_libraries (sleep_client_dyn sleep_plugin )
43- ament_target_dependencies (sleep_client_dyn ${THIS_PACKAGE_DEPS } )
43+ target_link_libraries (sleep_client_dyn ${THIS_PACKAGE_AMENT_TARGETS } )
4444
4545######################################################
4646# Build Server
4747add_executable (sleep_server src/sleep_server.cpp)
48- ament_target_dependencies (sleep_server ${THIS_PACKAGE_DEPS } )
48+ target_link_libraries (sleep_server ${THIS_PACKAGE_AMENT_TARGETS } )
4949
5050######################################################
5151# Build subscriber_test
5252add_executable (subscriber_test src/subscriber_test.cpp)
53- ament_target_dependencies (subscriber_test ${THIS_PACKAGE_DEPS } )
53+ target_link_libraries (subscriber_test ${THIS_PACKAGE_AMENT_TARGETS } )
5454
5555######################################################
5656# the SetBool test
5757add_executable (bool_client src/bool_client.cpp src/set_bool_node.cpp)
58- ament_target_dependencies (bool_client ${THIS_PACKAGE_DEPS } )
58+ target_link_libraries (bool_client ${THIS_PACKAGE_AMENT_TARGETS } )
5959
6060add_executable (bool_server src/bool_server.cpp )
61- ament_target_dependencies (bool_server ${THIS_PACKAGE_DEPS } )
61+ target_link_libraries (bool_server ${THIS_PACKAGE_AMENT_TARGETS } )
6262
6363######################################################
6464# INSTALL
0 commit comments