Browse Source

FindPkgConfig: Update cache variables after framework extraction

Kai Pastor 1 year ago
parent
commit
8fe6196714
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Modules/FindPkgConfig.cmake

+ 3 - 0
Modules/FindPkgConfig.cmake

@@ -656,6 +656,9 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma
 
       if (APPLE AND "-framework" IN_LIST ${_prefix}_LDFLAGS_OTHER)
         _pkgconfig_extract_frameworks("${_prefix}")
+        # Using _pkgconfig_set in this scope so that a future policy can switch to normal variables
+        _pkgconfig_set("${_pkg_check_prefix}_LIBRARIES" "${${_pkg_check_prefix}_LIBRARIES}")
+        _pkgconfig_set("${_pkg_check_prefix}_LDFLAGS_OTHER" "${${_pkg_check_prefix}_LDFLAGS_OTHER}")
       endif()
 
       _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS  "(^| )(-I|-isystem ?)" --cflags-only-I )