From 533bf22864966e5b9a080ee3384625b062705e6a Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 16 Nov 2022 07:46:50 +0100 Subject: [PATCH] Get target libraries from INTERFACE_LINK_LIBRARIES _LIB_DEPENDS is an internal variable that contains lots of other weird stuff. --- cmake/Modules/CMakeMacroLibtoolFile.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/CMakeMacroLibtoolFile.cmake b/cmake/Modules/CMakeMacroLibtoolFile.cmake index 9dfc6136..be336d51 100644 --- a/cmake/Modules/CMakeMacroLibtoolFile.cmake +++ b/cmake/Modules/CMakeMacroLibtoolFile.cmake @@ -9,14 +9,16 @@ macro(libtool_create_control_file _target) endif() # - # Parse the target_LIB_DEPENDS variable to determine which libraries to put - # into libtool control file as library dependencies, and handle a few corner - # cases. + # Parse the INTERFACE_LINK_LIBRARIES property to determine which + # libraries to put into libtool control file as library dependencies, + # and handle a few corner cases. # # First we need to split up any internal entries set(target_libs "") - foreach(library ${${_target}_LIB_DEPENDS}) + get_property(_target_libs TARGET ${_target} + PROPERTY INTERFACE_LINK_LIBRARIES) + foreach(library ${_target_libs}) if("${library}" MATCHES " ") string(REPLACE " " ";" lib_list "${library}") list(APPEND target_libs ${lib_list}) -- 2.39.5