Skip to content

Commit 46fe636

Browse files
authored
export targets in a addition to include directories / libraries (#371)
Signed-off-by: Dirk Thomas <[email protected]>
1 parent 45709b7 commit 46fe636

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

rmw_fastrtps_shared_cpp/CMakeLists.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ find_package(fastrtps REQUIRED CONFIG)
4545
find_package(FastRTPS REQUIRED MODULE)
4646

4747
find_package(rmw REQUIRED)
48-
include_directories(include)
4948

5049
add_library(rmw_fastrtps_shared_cpp
5150
src/custom_publisher_info.cpp
@@ -86,7 +85,10 @@ add_library(rmw_fastrtps_shared_cpp
8685
src/subscription.cpp
8786
src/TypeSupport_impl.cpp
8887
)
89-
88+
target_include_directories(rmw_fastrtps_shared_cpp
89+
PUBLIC
90+
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
91+
"$<INSTALL_INTERFACE:include>")
9092
target_link_libraries(rmw_fastrtps_shared_cpp
9193
fastcdr fastrtps
9294
)
@@ -107,6 +109,7 @@ PRIVATE "RMW_FASTRTPS_SHARED_CPP_BUILDING_LIBRARY")
107109
# specific order: dependents before dependencies
108110
ament_export_include_directories(include)
109111
ament_export_libraries(rmw_fastrtps_shared_cpp)
112+
ament_export_targets(rmw_fastrtps_shared_cpp)
110113

111114
ament_export_dependencies(rcpputils)
112115
ament_export_dependencies(rcutils)
@@ -128,7 +131,7 @@ install(
128131
)
129132

130133
install(
131-
TARGETS rmw_fastrtps_shared_cpp
134+
TARGETS rmw_fastrtps_shared_cpp EXPORT rmw_fastrtps_shared_cpp
132135
ARCHIVE DESTINATION lib
133136
LIBRARY DESTINATION lib
134137
RUNTIME DESTINATION bin

0 commit comments

Comments
 (0)