Skip to content

Commit

Permalink
find_*: Fix search order when the environment duplicates some HINTS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chuck Atkins authored and bradking committed Sep 14, 2015
1 parent 4a6fe02 commit 0244015
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions Source/cmFindBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ void cmFindBase::ExpandPaths()
{
this->FillCMakeEnvironmentPath();
}
}
this->FillUserHintsPath();
if(!this->NoDefaultPath)
{
if(!this->NoSystemEnvironmentPath)
{
this->FillSystemEnvironmentPath();
Expand All @@ -216,8 +220,6 @@ void cmFindBase::ExpandPaths()
this->FillCMakeSystemVariablePath();
}
}

this->FillUserHintsPath();
this->FillUserGuessPath();
}

Expand Down
5 changes: 4 additions & 1 deletion Source/cmFindPackageCommand.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,10 @@ void cmFindPackageCommand::ComputePrefixes()
{
this->FillPrefixesCMakeEnvironment();
}
}
this->FillPrefixesUserHints();
if(!this->NoDefaultPath)
{
if(!this->NoSystemEnvironmentPath)
{
this->FillPrefixesSystemEnvironment();
Expand All @@ -1150,7 +1154,6 @@ void cmFindPackageCommand::ComputePrefixes()
this->FillPrefixesSystemRegistry();
}
}
this->FillPrefixesUserHints();
this->FillPrefixesUserGuess();

this->ComputeFinalPaths();
Expand Down

0 comments on commit 0244015

Please sign in to comment.