set(link_libs ${new_libs})
while(NOT "${new_libs}" STREQUAL "")
foreach(lib ${new_libs})
- get_target_property(lib_type ${lib} TYPE)
- if("${lib_type}" STREQUAL "STATIC_LIBRARY")
- list(APPEND static_libs ${lib})
- else()
- list(APPEND other_libs ${lib})
- endif()
- get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES)
- foreach(transitive_lib ${transitive_libs})
- list(FIND link_libs ${transitive_lib} idx)
- if(TARGET ${transitive_lib} AND idx EQUAL -1)
- list(APPEND newer_libs ${transitive_lib})
- list(APPEND link_libs ${transitive_lib})
+ if(TARGET ${lib})
+ get_target_property(lib_type ${lib} TYPE)
+ if("${lib_type}" STREQUAL "STATIC_LIBRARY")
+ list(APPEND static_libs ${lib})
+ else()
+ list(APPEND other_libs ${lib})
endif()
- endforeach(transitive_lib)
+ get_target_property(transitive_libs ${lib} INTERFACE_LINK_LIBRARIES)
+ foreach(transitive_lib ${transitive_libs})
+ list(FIND link_libs ${transitive_lib} idx)
+ if(TARGET ${transitive_lib} AND idx EQUAL -1)
+ list(APPEND newer_libs ${transitive_lib})
+ list(APPEND link_libs ${transitive_lib})
+ endif()
+ endforeach(transitive_lib)
+ endif()
endforeach(lib)
set(new_libs ${newer_libs})
set(newer_libs "")