From 8dc9237c14176b609a31dfa00201641fc95b42ce Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Fri, 10 Apr 2020 13:43:44 -0700 Subject: [PATCH] use OUTPUT_NAME of exported library if set (#239) Signed-off-by: Dirk Thomas --- .../cmake/ament_export_libraries.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ament_cmake_export_libraries/cmake/ament_export_libraries.cmake b/ament_cmake_export_libraries/cmake/ament_export_libraries.cmake index 10ac4a44..cc099981 100644 --- a/ament_cmake_export_libraries/cmake/ament_export_libraries.cmake +++ b/ament_cmake_export_libraries/cmake/ament_export_libraries.cmake @@ -114,7 +114,12 @@ macro(ament_export_libraries) # they will be resolved via find_library() # relative to the CMAKE_INSTALL_PREFIX # when find_package() is invoked from a downstream package - list(APPEND _AMENT_EXPORT_LIBRARIES ${_cfg} "${_lib}") + get_target_property(_output_name ${_lib} OUTPUT_NAME) + if(_output_name) + list(APPEND _AMENT_EXPORT_LIBRARIES ${_cfg} "${_output_name}") + else() + list(APPEND _AMENT_EXPORT_LIBRARIES ${_cfg} "${_lib}") + endif() endif() else() # keep plain library names as-is