From 9db69836dbf80fee01e0ecd6e343574fffbf4f9a Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sun, 25 Sep 2022 10:33:24 +0200 Subject: [PATCH] Order both, interface and other include directories together Signed-off-by: Robert Haschke --- .../cmake/ament_target_dependencies.cmake | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake b/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake index ecf6c886..dbf78bff 100644 --- a/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake +++ b/ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake @@ -130,18 +130,21 @@ function(ament_target_dependencies target) endif() # fetch include directories of all transitive dependencies (already sorted) - ament_get_recursive_properties(interface_include_dirs_ordered _ ${interfaces}) + ament_get_recursive_properties(interface_include_dirs _ ${interfaces}) + # combine with include_dirs + list_append_unique(interface_include_dirs ${include_dirs}) + ament_include_directories_order(ordered_include_dirs ${interface_include_dirs}) - # the interface include dirs are used privately - just to ensure proper ordering - # the interfaces cover the public case + # ordered inlcude dirs are used privately - just to ensure proper ordering target_include_directories(${target} ${system_keyword} - PRIVATE ${interface_include_dirs_ordered}) + PRIVATE ${ordered_include_dirs}) - ament_include_directories_order(ordered_include_dirs ${include_dirs}) + # the following statements cover transitive forwarding target_link_libraries(${target} ${optional_keyword} ${interfaces}) target_include_directories(${target} ${system_keyword} - ${required_keyword} ${ordered_include_dirs}) + ${required_keyword} ${include_dirs}) + if(NOT ARG_INTERFACE) ament_libraries_deduplicate(unique_libraries ${libraries}) target_link_libraries(${target}