mirror of
https://github.com/curl/curl.git
synced 2026-08-25 09:33:36 +03:00
cmake: fix error getting LOCATION property on non-imported target
Closes #7885
This commit is contained in:
parent
d55b8b6a45
commit
399ef7a53c
1 changed files with 4 additions and 6 deletions
|
|
@ -1494,12 +1494,10 @@ set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
|
foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
|
||||||
if(TARGET "${_lib}")
|
if(TARGET "${_lib}")
|
||||||
set(_libname "${_lib}")
|
set(_libname "${_lib}")
|
||||||
get_target_property(_libtype "${_libname}" TYPE)
|
get_target_property(_imported "${_libname}" IMPORTED)
|
||||||
if(_libtype STREQUAL INTERFACE_LIBRARY)
|
if(NOT _imported)
|
||||||
# Interface libraries can occur when an external project embeds curl and
|
# Reading the LOCATION property on non-imported target will error out.
|
||||||
# defined targets such as ZLIB::ZLIB by themselves. Ignore these as
|
# Assume the user won't need this information in the .pc file.
|
||||||
# reading the LOCATION property will error out. Assume the user won't need
|
|
||||||
# this information in the .pc file.
|
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
get_target_property(_lib "${_libname}" LOCATION)
|
get_target_property(_lib "${_libname}" LOCATION)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue