diff options
author | Brad King <brad.king@kitware.com> | 2021-07-14 13:28:20 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-14 13:28:39 (GMT) |
commit | 89039dfed878c701c675627bbd33ea737d8415e0 (patch) | |
tree | 349c8f869b815385094b258a28d89078d1f81c77 /Modules | |
parent | 5e8a29c10b7b3ebe28a71acd41cd07015e5130f7 (diff) | |
parent | 36979f5b438b39599b074a291ad3cca3bfafc6bc (diff) | |
download | CMake-89039dfed878c701c675627bbd33ea737d8415e0.zip CMake-89039dfed878c701c675627bbd33ea737d8415e0.tar.gz CMake-89039dfed878c701c675627bbd33ea737d8415e0.tar.bz2 |
Merge topic 'FindPkgConfig-LIBRARY_PATH'
36979f5b43 FindPkgConfig: Tolerate PKG_CONFIG_SYSTEM_LIBRARY_PATH in environment
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6345
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index d39bbd0..a28f6bc 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -403,6 +403,14 @@ macro(_pkg_set_path_internal) unset(_lib_dirs) unset(_pkgconfig_path) endif() + + # Tell pkg-config not to strip any -L paths so we can search them all. + if(DEFINED ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}) + set(_pkgconfig_allow_system_libs_old "$ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS}") + else() + unset(_pkgconfig_allow_system_libs_old) + endif() + set(ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS} 0) endmacro() macro(_pkg_restore_path_internal) @@ -410,6 +418,10 @@ macro(_pkg_restore_path_internal) # Restore the environment variable set(ENV{PKG_CONFIG_PATH} "${_pkgconfig_path_old}") endif() + if(DEFINED _pkgconfig_allow_system_libs_old) + set(ENV{PKG_CONFIG_ALLOW_SYSTEM_LIBS} "${_pkgconfig_allow_system_libs_old}") + unset(_pkgconfig_allow_system_libs_old) + endif() unset(_extra_paths) unset(_pkgconfig_path_old) |