Commit 1178b536 authored by Brad King's avatar Brad King
Browse files

Merge branch 'fix-find_program-regression' into release

parents 1227ea38 31e6571c
......@@ -176,6 +176,13 @@ std::string cmFindProgramCommand::FindNormalProgramNamesPerDir()
{
helper.AddName(*ni);
}
// Check for the names themselves (e.g. absolute paths).
if (helper.CheckDirectory(std::string()))
{
return helper.BestPath;
}
// Search every directory.
for (std::vector<std::string>::const_iterator
p = this->SearchPaths.begin(); p != this->SearchPaths.end(); ++p)
......@@ -200,6 +207,12 @@ std::string cmFindProgramCommand::FindNormalProgramDirsPerName()
// Switch to searching for this name.
helper.SetName(*ni);
// Check for the name by itself (e.g. an absolute path).
if (helper.CheckDirectory(std::string()))
{
return helper.BestPath;
}
// Search every directory.
for (std::vector<std::string>::const_iterator
p = this->SearchPaths.begin();
......
-- PROG='[^']*/Tests/RunCMake/find_program/B/testB'
-- PROG_ABS='[^']*/Tests/RunCMake/find_program/A/testA'
......@@ -4,3 +4,9 @@ find_program(PROG
NO_DEFAULT_PATH
)
message(STATUS "PROG='${PROG}'")
find_program(PROG_ABS
NAMES ${CMAKE_CURRENT_SOURCE_DIR}/A/testA
NO_DEFAULT_PATH
)
message(STATUS "PROG_ABS='${PROG_ABS}'")
-- PROG='[^']*/Tests/RunCMake/find_program/A/testA'
-- PROG_ABS='[^']*/Tests/RunCMake/find_program/A/testA'
......@@ -4,3 +4,9 @@ find_program(PROG
NO_DEFAULT_PATH
)
message(STATUS "PROG='${PROG}'")
find_program(PROG_ABS
NAMES ${CMAKE_CURRENT_SOURCE_DIR}/A/testA NAMES_PER_DIR
NO_DEFAULT_PATH
)
message(STATUS "PROG_ABS='${PROG_ABS}'")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment