11cmake_minimum_required (VERSION 3.5)
22project (br2_bt_bumpgo)
33
4+ set (CMAKE_CXX_STANDARD 23)
5+
46set (CMAKE_CONFIG_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR} /cmake" )
57list (APPEND CMAKE_MODULE_PATH "${CMAKE_CONFIG_PATH} " )
68
79find_package (ament_cmake REQUIRED)
810find_package (rclcpp REQUIRED)
9- find_package (behaviortree_cpp_v3 REQUIRED)
11+ find_package (behaviortree_cpp REQUIRED)
1012find_package (sensor_msgs REQUIRED)
1113find_package (geometry_msgs REQUIRED)
1214find_package (ament_index_cpp REQUIRED)
1315
14- find_package (ZMQ)
15- if (ZMQ_FOUND)
16- message (STATUS "ZeroMQ found." )
17- add_definitions (-DZMQ_FOUND)
18- else ()
19- message (WARNING "ZeroMQ NOT found. Not including PublisherZMQ." )
20- endif ()
21-
22- set (CMAKE_CXX_STANDARD 17)
2316
2417set (dependencies
18+ rclcpp::rclcpp
19+ behaviortree_cpp::behaviortree_cpp
20+ ament_index_cpp::ament_index_cpp
21+ ${sensor_msgs_TARGETS}
22+ ${geometry_msgs_TARGETS}
23+ )
24+
25+ set (export_dependencies
2526 rclcpp
26- behaviortree_cpp_v3
27+ behaviortree_cpp
28+ ament_index_cpp
2729 sensor_msgs
2830 geometry_msgs
29- ament_index_cpp
3031)
3132
32- include_directories (include ${ZMQ_INCLUDE_DIRS} )
33-
3433add_library (br2_forward_bt_node SHARED src/br2_bt_bumpgo/Forward.cpp)
3534add_library (br2_back_bt_node SHARED src/br2_bt_bumpgo/Back.cpp)
3635add_library (br2_turn_bt_node SHARED src/br2_bt_bumpgo/Turn.cpp)
@@ -44,24 +43,28 @@ list(APPEND plugin_libs
4443)
4544
4645foreach (bt_plugin ${plugin_libs} )
47- ament_target_dependencies(${bt_plugin} ${dependencies} )
46+ target_include_directories (${bt_plugin} PUBLIC
47+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include >
48+ $<INSTALL_INTERFACE:include /${PROJECT_NAME} >
49+ )
50+ target_link_libraries (${bt_plugin} ${dependencies} )
4851 target_compile_definitions (${bt_plugin} PRIVATE BT_PLUGIN_EXPORT)
4952endforeach ()
5053
5154add_executable (bt_bumpgo src/bt_bumpgo_main.cpp)
52- ament_target_dependencies(bt_bumpgo ${dependencies} )
53- target_link_libraries (bt_bumpgo ${ZMQ_LIBRARIES} )
55+ target_link_libraries (bt_bumpgo ${dependencies} )
5456
5557install (TARGETS
5658 ${plugin_libs}
5759 bt_bumpgo
60+ EXPORT export_${PROJECT_NAME}
5861 ARCHIVE DESTINATION lib
5962 LIBRARY DESTINATION lib
6063 RUNTIME DESTINATION lib/${PROJECT_NAME}
6164)
6265
6366install (DIRECTORY include /
64- DESTINATION include /
67+ DESTINATION include /${PROJECT_NAME}
6568)
6669
6770install (DIRECTORY behavior_tree_xml
@@ -81,7 +84,9 @@ if(BUILD_TESTING)
8184 add_subdirectory (tests)
8285endif ()
8386
84- ament_export_include_directories(include )
85- ament_export_dependencies(${dependencies} )
87+ ament_export_include_directories("include/${PROJECT_NAME} " )
88+ ament_export_libraries(${bt_plugin} )
89+ ament_export_dependencies(${export_dependencies} )
90+ ament_export_targets(export_${PROJECT_NAME} )
8691
8792ament_package()
0 commit comments