summaryrefslogtreecommitdiffstats
path: root/Source/cmFindBase.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-04-16 08:57:30 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-04-29 20:00:02 (GMT)
commit8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5 (patch)
tree3463bda9324fb4bae11d6c470086b4b942246597 /Source/cmFindBase.cxx
parent08941a9a40c7786aa2ee8ff8e7c684eaf016513e (diff)
downloadCMake-8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5.zip
CMake-8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5.tar.gz
CMake-8d7e80cf3d39ae24a6c88ee07492b9cfe40defd5.tar.bz2
find_* commands: add control over Windows registry views
Fixes: #22775
Diffstat (limited to 'Source/cmFindBase.cxx')
-rw-r--r--Source/cmFindBase.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index a8db63d..702d9fe 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -7,6 +7,7 @@
#include <map>
#include <utility>
+#include <cm/optional>
#include <cmext/algorithm>
#include "cmCMakePath.h"
@@ -20,6 +21,7 @@
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
#include "cmValue.h"
+#include "cmWindowsRegistry.h"
#include "cmake.h"
class cmExecutionStatus;
@@ -123,6 +125,19 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
doing = DoingNone;
this->Required = true;
newStyle = true;
+ } else if (args[j] == "REGISTRY_VIEW") {
+ if (++j == args.size()) {
+ this->SetError("missing required argument for \"REGISTRY_VIEW\"");
+ return false;
+ }
+ auto view = cmWindowsRegistry::ToView(args[j]);
+ if (view) {
+ this->RegistryView = *view;
+ } else {
+ this->SetError(
+ cmStrCat("given invalid value for \"REGISTRY_VIEW\": ", args[j]));
+ return false;
+ }
} else if (this->CheckCommonArgument(args[j])) {
doing = DoingNone;
} else {