diff options
author | Brad King <brad.king@kitware.com> | 2015-11-02 14:09:46 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-11-02 14:09:46 (GMT) |
commit | b7b3b675fdb3240d8157b51d28bfe9b135d89302 (patch) | |
tree | 1dda33bc8c4ec9211c79f9660eddb8226831b93b /Source/cmFindProgramCommand.cxx | |
parent | 96ac964d765108ea0bf2c37567efdf777a6047e4 (diff) | |
parent | 31e6571cca3267cf1f5e17df7c985521211885ef (diff) | |
download | CMake-b7b3b675fdb3240d8157b51d28bfe9b135d89302.zip CMake-b7b3b675fdb3240d8157b51d28bfe9b135d89302.tar.gz CMake-b7b3b675fdb3240d8157b51d28bfe9b135d89302.tar.bz2 |
Merge topic 'fix-find_program-regression'
31e6571c find_program: Fix regression in finding an already-known path
Diffstat (limited to 'Source/cmFindProgramCommand.cxx')
-rw-r--r-- | Source/cmFindProgramCommand.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
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(); |