Skip to content

Commit

Permalink
export targets in a addition to include directories / libraries (ros2…
Browse files Browse the repository at this point in the history
…#629)

Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
  • Loading branch information
dirk-thomas committed Apr 22, 2020
1 parent 4f0406f commit 0a48e6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ find_package(rmw_implementation REQUIRED)
find_package(rosidl_runtime_c REQUIRED)
find_package(tracetools REQUIRED)

include_directories(include)
include(cmake/rcl_set_symbol_visibility_hidden.cmake)
include(cmake/get_default_rcl_logging_implementation.cmake)
get_default_rcl_logging_implementation(RCL_LOGGING_IMPL)
Expand Down Expand Up @@ -64,6 +63,9 @@ set(${PROJECT_NAME}_sources
)

add_library(${PROJECT_NAME} ${${PROJECT_NAME}_sources})
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
# specific order: dependents before dependencies
ament_target_dependencies(${PROJECT_NAME}
"rcl_interfaces"
Expand All @@ -82,7 +84,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE "RCL_BUILDING_DLL")
rcl_set_symbol_visibility_hidden(${PROJECT_NAME} LANGUAGE "C")

install(
TARGETS ${PROJECT_NAME}
TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
Expand All @@ -96,6 +98,7 @@ set(rcl_lib_dir "$<TARGET_FILE_DIR:${PROJECT_NAME}>")
# 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(rcl_interfaces)
Expand Down

0 comments on commit 0a48e6b

Please sign in to comment.