From bb2299bc878a638d5a81226c21cb918359e773fc Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Thu, 22 Sep 2022 22:42:03 +0200 Subject: [PATCH] Ignore generator expressions used in PKG_CONFIG_LIBRARIES --- cmake/templates/pkgConfig.cmake.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/templates/pkgConfig.cmake.in b/cmake/templates/pkgConfig.cmake.in index 8740d9944..92199d4ec 100644 --- a/cmake/templates/pkgConfig.cmake.in +++ b/cmake/templates/pkgConfig.cmake.in @@ -118,7 +118,7 @@ endif() set(libraries "@PKG_CONFIG_LIBRARIES@") foreach(library ${libraries}) - # keep build configuration keywords, target names and absolute libraries as-is + # keep build configuration keywords, generator expressions, target names, and absolute libraries as-is if("${library}" MATCHES "^(debug|optimized|general)$") list(APPEND @PROJECT_NAME@_LIBRARIES ${library}) elseif(${library} MATCHES "^-l") @@ -146,6 +146,8 @@ foreach(library ${libraries}) target_link_options("${interface_target_name}" INTERFACE "${library}") endif() list(APPEND @PROJECT_NAME@_LIBRARIES "${interface_target_name}") + elseif(${library} MATCHES "^\\$<") + list(APPEND @PROJECT_NAME@_LIBRARIES ${library}) elseif(TARGET ${library}) list(APPEND @PROJECT_NAME@_LIBRARIES ${library}) elseif(IS_ABSOLUTE ${library})