Merge topic 'test-search-ordering'
7a6e5f06
Tests: Cover find_program when the environment duplicate some HINTS40122975
Merge branch 'fix-bad-search-ordering' into test-search-ordering02440154
find_*: Fix search order when the environment duplicates some HINTS
This commit is contained in:
commit
982850a866
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
|
@ -0,0 +1 @@
|
|||
#!/bin/sh
|
|
@ -0,0 +1 @@
|
|||
-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB'
|
|
@ -0,0 +1,8 @@
|
|||
set(ENV_PATH "$ENV{PATH}")
|
||||
set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A)
|
||||
find_program(PROG
|
||||
NAMES testAandB
|
||||
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
|
||||
)
|
||||
message(STATUS "PROG='${PROG}'")
|
||||
set(ENV{PATH} "${ENV_PATH}")
|
|
@ -1,5 +1,6 @@
|
|||
include(RunCMake)
|
||||
|
||||
run_cmake(EnvAndHints)
|
||||
run_cmake(DirsPerName)
|
||||
run_cmake(NamesPerDir)
|
||||
|
||||
|
|
Loading…
Reference in New Issue