diff options
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index c944515..7f9bb12 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -734,7 +734,13 @@ std::string cmSystemTools::FindProgram(const char* name, { return cmSystemTools::CollapseFullPath(name); } - + std::string tryPath = name; + tryPath += cmSystemTools::GetExecutableExtension(); + if(cmSystemTools::FileExists(tryPath.c_str())) + { + return cmSystemTools::CollapseFullPath(tryPath.c_str()); + } + // Add the system search path to our path. std::vector<std::string> path = userPaths; cmSystemTools::GetPath(path); @@ -742,7 +748,7 @@ std::string cmSystemTools::FindProgram(const char* name, for(std::vector<std::string>::const_iterator p = path.begin(); p != path.end(); ++p) { - std::string tryPath = *p; + tryPath = *p; tryPath += "/"; tryPath += name; if(cmSystemTools::FileExists(tryPath.c_str())) |