summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2020-06-04 11:28:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-06-21 19:37:28 +0200
commit26d2755d7c3181e90e46014778941bff53d2309f (patch)
treef4f47e6e2b3295d602c5658c22ee3cce744591bf /CMakeLists.txt
parente39a6e2ceaa5a2ad70f4f6aa5ed7056b25a52ccd (diff)
downloadcurl-26d2755d7c3181e90e46014778941bff53d2309f.tar.gz
CMake: ignore INTERFACE_LIBRARY targets for pkg-config file
Reviewed-by: Marcel Raad Fixes #5512 Closes #5517
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a13395db7..5a1333397 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1413,7 +1413,15 @@ set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
if(TARGET "${_lib}")
set(_libname "${_lib}")
- get_target_property(_lib "${_lib}" LOCATION)
+ 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.
+ continue()
+ endif()
+ get_target_property(_lib "${_libname}" LOCATION)
if(NOT _lib)
message(WARNING "Bad lib in library list: ${_libname}")
continue()