diff --git a/rclcpp_action/CMakeLists.txt b/rclcpp_action/CMakeLists.txt index 25bc985..48555ed 100644 --- a/rclcpp_action/CMakeLists.txt +++ b/rclcpp_action/CMakeLists.txt @@ -16,8 +16,6 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Wall -Wextra -Wpedantic) endif() -include_directories(include) - set(${PROJECT_NAME}_SRCS src/client.cpp src/qos.cpp @@ -29,6 +27,11 @@ set(${PROJECT_NAME}_SRCS add_library(${PROJECT_NAME} ${${PROJECT_NAME}_SRCS}) +target_include_directories(${PROJECT_NAME} + PUBLIC + "$" + "$") + ament_target_dependencies(${PROJECT_NAME} "action_msgs" "rcl_action" @@ -47,6 +50,7 @@ install( install( TARGETS ${PROJECT_NAME} + EXPORT ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin @@ -55,6 +59,7 @@ install( # specific order: dependents before dependencies ament_export_include_directories(include) ament_export_libraries(${PROJECT_NAME}) +ament_export_targets(${PROJECT_NAME}) ament_export_dependencies(ament_cmake) ament_export_dependencies(action_msgs) diff --git a/rclcpp_lifecycle/CMakeLists.txt b/rclcpp_lifecycle/CMakeLists.txt index d7a195f..ab4cf4f 100644 --- a/rclcpp_lifecycle/CMakeLists.txt +++ b/rclcpp_lifecycle/CMakeLists.txt @@ -16,8 +16,6 @@ find_package(rcl_lifecycle REQUIRED) find_package(rosidl_typesupport_cpp REQUIRED) find_package(lifecycle_msgs REQUIRED) -include_directories(include) - ### CPP High level library add_library(rclcpp_lifecycle src/lifecycle_node.cpp @@ -25,6 +23,10 @@ add_library(rclcpp_lifecycle src/state.cpp src/transition.cpp ) +target_include_directories(${PROJECT_NAME} + PUBLIC + "$" + "$") # specific order: dependents before dependencies ament_target_dependencies(rclcpp_lifecycle "rclcpp" @@ -38,7 +40,7 @@ ament_target_dependencies(rclcpp_lifecycle target_compile_definitions(rclcpp_lifecycle PRIVATE "RCLCPP_LIFECYCLE_BUILDING_DLL") install(TARGETS - rclcpp_lifecycle + rclcpp_lifecycle EXPORT rclcpp_lifecycle ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) @@ -102,6 +104,7 @@ endif() # specific order: dependents before dependencies ament_export_include_directories(include) ament_export_libraries(${PROJECT_NAME}) +ament_export_targets(${PROJECT_NAME}) ament_export_dependencies(rclcpp) ament_export_dependencies(rcl_lifecycle) ament_export_dependencies(lifecycle_msgs)