From 4dbf47bf3eb658fc48b8a0aaf4619b328821b2cc Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Wed, 22 Apr 2020 11:19:08 -0700 Subject: [PATCH] export targets in a addition to include directories / libraries Signed-off-by: Dirk Thomas --- rmw_fastrtps_shared_cpp/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rmw_fastrtps_shared_cpp/CMakeLists.txt b/rmw_fastrtps_shared_cpp/CMakeLists.txt index c3f98a0f9..98deef706 100644 --- a/rmw_fastrtps_shared_cpp/CMakeLists.txt +++ b/rmw_fastrtps_shared_cpp/CMakeLists.txt @@ -45,7 +45,6 @@ find_package(fastrtps REQUIRED CONFIG) find_package(FastRTPS REQUIRED MODULE) find_package(rmw REQUIRED) -include_directories(include) add_library(rmw_fastrtps_shared_cpp src/custom_publisher_info.cpp @@ -86,7 +85,10 @@ add_library(rmw_fastrtps_shared_cpp src/subscription.cpp src/TypeSupport_impl.cpp ) - +target_include_directories(rmw_fastrtps_shared_cpp + PUBLIC + "$" + "$") target_link_libraries(rmw_fastrtps_shared_cpp fastcdr fastrtps ) @@ -107,6 +109,7 @@ PRIVATE "RMW_FASTRTPS_SHARED_CPP_BUILDING_LIBRARY") # specific order: dependents before dependencies ament_export_include_directories(include) ament_export_libraries(rmw_fastrtps_shared_cpp) +ament_export_targets(rmw_fastrtps_shared_cpp) ament_export_dependencies(rcpputils) ament_export_dependencies(rcutils) @@ -128,7 +131,7 @@ install( ) install( - TARGETS rmw_fastrtps_shared_cpp + TARGETS rmw_fastrtps_shared_cpp EXPORT rmw_fastrtps_shared_cpp ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION bin