From 62849e8939512271b0001c6de79329dd18c6555f Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Thu, 9 Apr 2020 21:52:54 -0700 Subject: [PATCH] use OUTPUT_NAME of exported library if set 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