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})