From 2f76cdc9e4ff4598d97305759effdcb7207683c2 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Mon, 27 Apr 2020 10:30:30 -0700 Subject: [PATCH] export targets in a addition to include directories / libraries (#635) Signed-off-by: Dirk Thomas --- rcl_lifecycle/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rcl_lifecycle/CMakeLists.txt b/rcl_lifecycle/CMakeLists.txt index 6df980f..4cb2ec5 100644 --- a/rcl_lifecycle/CMakeLists.txt +++ b/rcl_lifecycle/CMakeLists.txt @@ -10,8 +10,6 @@ find_package(rcutils REQUIRED) find_package(rmw REQUIRED) find_package(rosidl_runtime_c REQUIRED) -include_directories(include) - # Default to C11 if(NOT CMAKE_C_STANDARD) set(CMAKE_C_STANDARD 11) @@ -41,6 +39,10 @@ add_library( ${PROJECT_NAME} ${rcl_lifecycle_sources}) +target_include_directories(${PROJECT_NAME} PUBLIC + "$" + "$") + # specific order: dependents before dependencies ament_target_dependencies(rcl_lifecycle "lifecycle_msgs" @@ -54,7 +56,7 @@ rcl_set_symbol_visibility_hidden(${PROJECT_NAME} LANGUAGE "C") # which is appropriate when building the dll but not consuming it. target_compile_definitions(rcl_lifecycle PRIVATE "RCL_LIFECYCLE_BUILDING_DLL") -install(TARGETS rcl_lifecycle +install(TARGETS rcl_lifecycle EXPORT rcl_lifecycle ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin) @@ -101,6 +103,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(ament_cmake) ament_export_dependencies(lifecycle_msgs) ament_export_dependencies(rcl)