diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2021-08-14 14:48:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-08-18 18:51:50 (GMT) |
commit | 17e4934dbfa6df048e201bf0f0b46ad8d0e279ef (patch) | |
tree | 1bca7a0d402872fa02f8be2be117a815ec92ce73 /Modules | |
parent | 3de5096094b440b75887467a79e04eaafb2ba236 (diff) | |
download | CMake-17e4934dbfa6df048e201bf0f0b46ad8d0e279ef.zip CMake-17e4934dbfa6df048e201bf0f0b46ad8d0e279ef.tar.gz CMake-17e4934dbfa6df048e201bf0f0b46ad8d0e279ef.tar.bz2 |
FindPkgConfig: Restore legacy behavior when CMP0126 is set to NEW
Module behavior must be independent from `CMP0126` policy.
Fixes: #22526
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPkgConfig.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 3bc9dba..01ad5ac 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -79,10 +79,18 @@ set(PKG_CONFIG_FOUND "${PKGCONFIG_FOUND}") # Unsets the given variables macro(_pkgconfig_unset var) + # Clear normal variable (possibly set by project code). + unset(${var}) + # Store as cache variable. + # FIXME: Add a policy to switch to a normal variable. set(${var} "" CACHE INTERNAL "") endmacro() macro(_pkgconfig_set var value) + # Clear normal variable (possibly set by project code). + unset(${var}) + # Store as cache variable. + # FIXME: Add a policy to switch to a normal variable. set(${var} ${value} CACHE INTERNAL "") endmacro() |