From 0a795cc776ebedf36b003db23a2246e022d9518b Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Mon, 20 Apr 2020 09:33:04 -0700 Subject: [PATCH] export targets in a addition to include directories / libraries (#621) Signed-off-by: Dirk Thomas --- rcl_yaml_param_parser/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rcl_yaml_param_parser/CMakeLists.txt b/rcl_yaml_param_parser/CMakeLists.txt index 49c7577..c106de0 100644 --- a/rcl_yaml_param_parser/CMakeLists.txt +++ b/rcl_yaml_param_parser/CMakeLists.txt @@ -16,8 +16,6 @@ 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 ) @@ -25,6 +23,9 @@ set(rcl_yaml_parser_sources add_library( ${PROJECT_NAME} ${rcl_yaml_parser_sources}) +target_include_directories(${PROJECT_NAME} PUBLIC + "$" + "$") ament_target_dependencies(${PROJECT_NAME} "yaml" "rcutils") # Set the visibility to hidden by default if possible @@ -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) @@ -72,4 +73,5 @@ install( DESTINATION include ) ament_export_libraries(${PROJECT_NAME}) +ament_export_targets(${PROJECT_NAME}) ament_package()