summaryrefslogtreecommitdiffstats
path: root/Source/cmFindCommon.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmFindCommon.cxx')
-rw-r--r--Source/cmFindCommon.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index 7106e4b..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"
@@ -39,6 +40,7 @@ cmFindCommon::cmFindCommon(cmExecutionStatus& status)
this->NoCMakeEnvironmentPath = false;
this->NoSystemEnvironmentPath = false;
this->NoCMakeSystemPath = false;
+ this->NoCMakeInstallPath = false;
// OS X Bundle and Framework search policy. The default is to
// search frameworks first on apple.
@@ -57,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)
@@ -179,14 +192,15 @@ void cmFindCommon::SelectDefaultMacMode()
void cmFindCommon::SelectDefaultSearchModes()
{
- const std::array<std::pair<bool&, std::string>, 5> search_paths = {
+ const std::array<std::pair<bool&, std::string>, 6> search_paths = {
{ { this->NoPackageRootPath, "CMAKE_FIND_USE_PACKAGE_ROOT_PATH" },
{ this->NoCMakePath, "CMAKE_FIND_USE_CMAKE_PATH" },
{ this->NoCMakeEnvironmentPath,
"CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH" },
{ this->NoSystemEnvironmentPath,
"CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH" },
- { this->NoCMakeSystemPath, "CMAKE_FIND_USE_CMAKE_SYSTEM_PATH" } }
+ { this->NoCMakeSystemPath, "CMAKE_FIND_USE_CMAKE_SYSTEM_PATH" },
+ { this->NoCMakeInstallPath, "CMAKE_FIND_USE_INSTALL_PREFIX" } }
};
for (auto const& path : search_paths) {
@@ -348,6 +362,8 @@ bool cmFindCommon::CheckCommonArgument(std::string const& arg)
this->NoSystemEnvironmentPath = true;
} else if (arg == "NO_CMAKE_SYSTEM_PATH") {
this->NoCMakeSystemPath = true;
+ } else if (arg == "NO_CMAKE_INSTALL_PREFIX") {
+ this->NoCMakeInstallPath = true;
} else if (arg == "NO_CMAKE_FIND_ROOT_PATH") {
this->FindRootPathMode = RootPathModeNever;
} else if (arg == "ONLY_CMAKE_FIND_ROOT_PATH") {