[Cmake-commits] CMake branch, next, updated. v3.4.0-rc2-1196-g20a2a98
Brad King
brad.king at kitware.com
Fri Oct 30 07:41:40 EDT 2015
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 20a2a98d7b2f61dd3ac74b7073a15ca84efb517d (commit)
via 31e6571cca3267cf1f5e17df7c985521211885ef (commit)
from 2a94c83c8babd8c42001d593dbafe6faaf291938 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=20a2a98d7b2f61dd3ac74b7073a15ca84efb517d
commit 20a2a98d7b2f61dd3ac74b7073a15ca84efb517d
Merge: 2a94c83 31e6571
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Oct 30 07:41:38 2015 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Oct 30 07:41:38 2015 -0400
Merge topic 'fix-find_program-regression' into next
31e6571c find_program: Fix regression in finding an already-known path
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=31e6571cca3267cf1f5e17df7c985521211885ef
commit 31e6571cca3267cf1f5e17df7c985521211885ef
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Oct 29 17:50:19 2015 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Fri Oct 30 07:40:46 2015 -0400
find_program: Fix regression in finding an already-known path
Changes in commit v3.4.0-rc1~124^2~1 (cmFindProgramCommand: Re-implement
search using more flexible approach, 2015-09-01) did not preserve the
behavior of looking for the given name with no search path at all.
Fix this and add a test case covering finding an absolute path with
no search directories.
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index e64ed87..219ad48 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -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();
diff --git a/Tests/RunCMake/find_program/DirsPerName-stdout.txt b/Tests/RunCMake/find_program/DirsPerName-stdout.txt
index f763bb0..dc1c82b 100644
--- a/Tests/RunCMake/find_program/DirsPerName-stdout.txt
+++ b/Tests/RunCMake/find_program/DirsPerName-stdout.txt
@@ -1 +1,2 @@
-- PROG='[^']*/Tests/RunCMake/find_program/B/testB'
+-- PROG_ABS='[^']*/Tests/RunCMake/find_program/A/testA'
diff --git a/Tests/RunCMake/find_program/DirsPerName.cmake b/Tests/RunCMake/find_program/DirsPerName.cmake
index 54db6dd..6db778d 100644
--- a/Tests/RunCMake/find_program/DirsPerName.cmake
+++ b/Tests/RunCMake/find_program/DirsPerName.cmake
@@ -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}'")
diff --git a/Tests/RunCMake/find_program/NamesPerDir-stdout.txt b/Tests/RunCMake/find_program/NamesPerDir-stdout.txt
index 964e259..fd79185 100644
--- a/Tests/RunCMake/find_program/NamesPerDir-stdout.txt
+++ b/Tests/RunCMake/find_program/NamesPerDir-stdout.txt
@@ -1 +1,2 @@
-- PROG='[^']*/Tests/RunCMake/find_program/A/testA'
+-- PROG_ABS='[^']*/Tests/RunCMake/find_program/A/testA'
diff --git a/Tests/RunCMake/find_program/NamesPerDir.cmake b/Tests/RunCMake/find_program/NamesPerDir.cmake
index 49ce49d..5f00a28 100644
--- a/Tests/RunCMake/find_program/NamesPerDir.cmake
+++ b/Tests/RunCMake/find_program/NamesPerDir.cmake
@@ -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}'")
-----------------------------------------------------------------------
Summary of changes:
Source/cmFindProgramCommand.cxx | 13 +++++++++++++
Tests/RunCMake/find_program/DirsPerName-stdout.txt | 1 +
Tests/RunCMake/find_program/DirsPerName.cmake | 6 ++++++
Tests/RunCMake/find_program/NamesPerDir-stdout.txt | 1 +
Tests/RunCMake/find_program/NamesPerDir.cmake | 6 ++++++
5 files changed, 27 insertions(+)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list