foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
if(TARGET "${_lib}")
set(_libname "${_lib}")
- get_target_property(_libtype "${_libname}" TYPE)
- if(_libtype STREQUAL INTERFACE_LIBRARY)
- # Interface libraries can occur when an external project embeds curl and
- # defined targets such as ZLIB::ZLIB by themselves. Ignore these as
- # reading the LOCATION property will error out. Assume the user won't need
- # this information in the .pc file.
+ get_target_property(_imported "${_libname}" IMPORTED)
+ if(NOT _imported)
+ # Reading the LOCATION property on non-imported target will error out.
+ # Assume the user won't need this information in the .pc file.
continue()
endif()
get_target_property(_lib "${_libname}" LOCATION)