Skip to content

Commit

Permalink
export modern CMake interface target (ros2#263)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <[email protected]>
  • Loading branch information
dirk-thomas authored May 1, 2020
1 parent ad90aee commit 7e23566
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tf2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ find_package(console_bridge REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rcutils REQUIRED)

include_directories(include src/bt)

# export user definitions

#CPP Libraries
add_library(tf2 SHARED src/cache.cpp src/buffer_core.cpp src/static_cache.cpp src/time.cpp)
target_include_directories(tf2 PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/bt>"
"$<INSTALL_INTERFACE:include>")
ament_target_dependencies(tf2
"console_bridge"
"geometry_msgs"
Expand All @@ -27,7 +29,7 @@ ament_target_dependencies(tf2
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(tf2 PRIVATE "TF2_BUILDING_DLL")

install(TARGETS tf2
install(TARGETS tf2 EXPORT tf2
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
Expand Down Expand Up @@ -87,4 +89,5 @@ endif()
ament_export_dependencies(console_bridge geometry_msgs rcutils)
ament_export_include_directories(include)
ament_export_libraries(tf2)
ament_export_targets(tf2)
ament_package()

0 comments on commit 7e23566

Please sign in to comment.