Skip to content

Commit

Permalink
export targets in a addition to include directories / libraries (#621)
Browse files Browse the repository at this point in the history
Signed-off-by: Dirk Thomas <[email protected]>
  • Loading branch information
dirk-thomas authored Apr 20, 2020
1 parent 918dd5a commit 0a795cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions rcl_yaml_param_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

include_directories(include ${yaml_INCLUDE_DIRS} ${rcutils_INCLUDE_DIRS})

set(rcl_yaml_parser_sources
src/parser.c
)

add_library(
${PROJECT_NAME}
${rcl_yaml_parser_sources})
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils")

# Set the visibility to hidden by default if possible
Expand All @@ -41,7 +42,7 @@ endif()
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME} PRIVATE "RCL_YAML_PARAM_PARSER_BUILDING_DLL")

install(TARGETS ${PROJECT_NAME}
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
Expand Down Expand Up @@ -72,4 +73,5 @@ install(
DESTINATION include
)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME})
ament_package()

0 comments on commit 0a795cc

Please sign in to comment.