export targets in a addition to include directories / libraries (#629)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
This commit is contained in:
parent
4f0406f754
commit
0a48e6bd7b
1 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
@ -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"
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue