diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2022-04-16 08:57:30 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2022-04-29 20:00:02 (GMT) |
commit | 8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5 (patch) | |
tree | 3463bda9324fb4bae11d6c470086b4b942246597 /Source/cmFindCommon.cxx | |
parent | 08941a9a40c7786aa2ee8ff8e7c684eaf016513e (diff) | |
download | CMake-8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5.zip CMake-8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5.tar.gz CMake-8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5.tar.bz2 |
find_* commands: add control over Windows registry views
Fixes: #22775
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r-- | Source/cmFindCommon.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 9fd712a..c3fb907 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -11,6 +11,7 @@ #include "cmExecutionStatus.h" #include "cmMakefile.h" #include "cmMessageType.h" +#include "cmPolicies.h" #include "cmStringAlgorithms.h" #include "cmSystemTools.h" #include "cmValue.h" @@ -58,6 +59,17 @@ cmFindCommon::cmFindCommon(cmExecutionStatus& status) this->InitializeSearchPathGroups(); this->DebugMode = false; + + // Windows Registry views + // When policy CMP0134 is not NEW, rely on previous behavior: + if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0134) != + cmPolicies::NEW) { + if (this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P") == "8") { + this->RegistryView = cmWindowsRegistry::View::Reg64; + } else { + this->RegistryView = cmWindowsRegistry::View::Reg32; + } + } } void cmFindCommon::SetError(std::string const& e) |