find_*: Fix search order when the environment duplicates some HINTS

Refactoring in the topic merged by commit v3.2.0-rc1~400 (Merge topic
'refactor-search-path-construction', 2014-11-13) introduced a bug that
filters out duplicate paths in an incorrect order.  Restore the search
path to its documented order even when duplicate paths are present.

Reported-by: Marc CHEVRIER <marc.chevrier@sap.com>
This commit is contained in:
Chuck Atkins 2015-09-09 16:03:04 -04:00 committed by Brad King
parent 4a6fe02908
commit 02440154fb
2 changed files with 8 additions and 3 deletions

View File

@ -207,6 +207,10 @@ void cmFindBase::ExpandPaths()
{
this->FillCMakeEnvironmentPath();
}
}
this->FillUserHintsPath();
if(!this->NoDefaultPath)
{
if(!this->NoSystemEnvironmentPath)
{
this->FillSystemEnvironmentPath();
@ -216,8 +220,6 @@ void cmFindBase::ExpandPaths()
this->FillCMakeSystemVariablePath();
}
}
this->FillUserHintsPath();
this->FillUserGuessPath();
}

View File

@ -1133,6 +1133,10 @@ void cmFindPackageCommand::ComputePrefixes()
{
this->FillPrefixesCMakeEnvironment();
}
}
this->FillPrefixesUserHints();
if(!this->NoDefaultPath)
{
if(!this->NoSystemEnvironmentPath)
{
this->FillPrefixesSystemEnvironment();
@ -1150,7 +1154,6 @@ void cmFindPackageCommand::ComputePrefixes()
this->FillPrefixesSystemRegistry();
}
}
this->FillPrefixesUserHints();
this->FillPrefixesUserGuess();
this->ComputeFinalPaths();