diff options
author | Brad King <brad.king@kitware.com> | 2015-05-07 20:21:29 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-08 15:27:02 (GMT) |
commit | 1506f9ca56c813f6c1fee4cea90a1cd8e5a4a04d (patch) | |
tree | e8d4d85b8bbb7e8b8255863a4f0b0cd46816abe0 /Source | |
parent | 8d484463725edec792c26fdd33547f7ad63c2c14 (diff) | |
download | CMake-1506f9ca56c813f6c1fee4cea90a1cd8e5a4a04d.zip CMake-1506f9ca56c813f6c1fee4cea90a1cd8e5a4a04d.tar.gz CMake-1506f9ca56c813f6c1fee4cea90a1cd8e5a4a04d.tar.bz2 |
find_package: Drop search in recent cmake-gui locations
The find_package command, on Windows, has always searched build trees
recently visited by cmake-gui (or CMakeSetup at one time). This was
done when the command was created with the intention of simplifying
workflows involving building multiple dependent projects. However,
this behavior depends on recent developer interaction and therefore
can create different find results based on transient system states.
It can lead to surprising results and user confusion.
Since this behavior was first added CMake has gained many more search
options, better error messages when a package is not found, and a
package registry. The latter in particular allows projects to make
their build trees available for dependent projects to find without
user intervention. Therefore the originally intended workflow can
be achieved in other, more stable ways.
After the above evoluion of find_package we have now decided that
the magic search-where-cmake-gui-was behavior does more harm than
good. Drop it. We do not need a policy for this behavior change
because it only affects interactive use.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 30 | ||||
-rw-r--r-- | Source/cmFindPackageCommand.h | 2 |
2 files changed, 1 insertions, 31 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 4d568e9..68a6558 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -42,7 +42,6 @@ cmFindPackageCommand::cmFindPackageCommand() this->Required = false; this->NoUserRegistry = false; this->NoSystemRegistry = false; - this->NoBuilds = false; this->UseConfigFiles = true; this->UseFindModules = true; this->DebugMode = false; @@ -246,7 +245,7 @@ bool cmFindPackageCommand } else if(args[i] == "NO_CMAKE_BUILDS_PATH") { - this->NoBuilds = true; + // Ignore legacy option. configArgs.insert(i); doing = DoingNone; } @@ -1142,10 +1141,6 @@ void cmFindPackageCommand::ComputePrefixes() { this->FillPrefixesUserRegistry(); } - if(!this->NoBuilds) - { - this->FillPrefixesBuilds(); - } if(!this->NoCMakeSystemPath) { this->FillPrefixesCMakeSystemVariable(); @@ -1438,29 +1433,6 @@ bool cmFindPackageCommand::CheckPackageRegistryEntry(const std::string& fname, } //---------------------------------------------------------------------------- -void cmFindPackageCommand::FillPrefixesBuilds() -{ - cmSearchPath &paths = this->LabeledPaths[PathLabel::Builds]; - - // It is likely that CMake will have recently built the project. - for(int i=0; i <= 10; ++i) - { - std::ostringstream r; - r << - "[HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\" - "Settings\\StartPath;WhereBuild" << i << "]"; - std::string f = r.str(); - cmSystemTools::ExpandRegistryValues(f); - cmSystemTools::ConvertToUnixSlashes(f); - if(cmSystemTools::FileIsFullPath(f.c_str()) && - cmSystemTools::FileIsDirectory(f)) - { - paths.AddPath(f); - } - } -} - -//---------------------------------------------------------------------------- void cmFindPackageCommand::FillPrefixesCMakeSystemVariable() { cmSearchPath &paths = this->LabeledPaths[PathLabel::CMakeSystem]; diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 949dcb1..3eee404 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -89,7 +89,6 @@ private: void FillPrefixesSystemEnvironment(); void FillPrefixesUserRegistry(); void FillPrefixesSystemRegistry(); - void FillPrefixesBuilds(); void FillPrefixesCMakeSystemVariable(); void FillPrefixesUserGuess(); void FillPrefixesUserHints(); @@ -138,7 +137,6 @@ private: bool UseFindModules; bool NoUserRegistry; bool NoSystemRegistry; - bool NoBuilds; bool DebugMode; bool UseLib64Paths; bool PolicyScope; |