summaryrefslogtreecommitdiff
path: root/Source/cmFindPathCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-20 17:24:46 -0500
committerBrad King <brad.king@kitware.com>2008-01-20 17:24:46 -0500
commitc7b844ba3e03aee882a8b629885ca49ecc06c146 (patch)
tree7f0332f5fa5f304a9b45370c17023c751938e474 /Source/cmFindPathCommand.cxx
parent9de44ef28a99f45069205d39026896bfcaac2ba5 (diff)
downloadcmake-c7b844ba3e03aee882a8b629885ca49ecc06c146.tar.gz
BUG: Make sure search paths never have double-slashes. Leading with two slashes (//) on cygwin looks like a network path and delays while waiting for a non-existent machine.
Diffstat (limited to 'Source/cmFindPathCommand.cxx')
-rw-r--r--Source/cmFindPathCommand.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/cmFindPathCommand.cxx b/Source/cmFindPathCommand.cxx
index f322b43f4f..53531dde37 100644
--- a/Source/cmFindPathCommand.cxx
+++ b/Source/cmFindPathCommand.cxx
@@ -101,6 +101,16 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
supportFrameworks = false;
}
std::string framework;
+ // Add a trailing slash to all paths to aid the search process.
+ for(std::vector<std::string>::iterator i = this->SearchPaths.begin();
+ i != this->SearchPaths.end(); ++i)
+ {
+ std::string& p = *i;
+ if(p[p.size()-1] != '/')
+ {
+ p += "/";
+ }
+ }
// Use the search path to find the file.
unsigned int k;
std::string result;
@@ -122,7 +132,6 @@ bool cmFindPathCommand::InitialPass(std::vector<std::string> const& argsIn)
if(result.size() == 0)
{
tryPath = this->SearchPaths[k];
- tryPath += "/";
tryPath += this->Names[j];
if(cmSystemTools::FileExists(tryPath.c_str()))
{
@@ -181,7 +190,6 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string& file,
if(frameWorkName.size())
{
std::string fpath = dir;
- fpath += "/";
fpath += frameWorkName;
fpath += ".framework";
std::string intPath = fpath;
@@ -200,7 +208,7 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string& file,
// if it is not found yet or not a framework header, then do a glob search
// for all files in dir/*/Headers/
cmStdString glob = dir;
- glob += "/*/Headers/";
+ glob += "*/Headers/";
glob += file;
cmsys::Glob globIt;
globIt.FindFiles(glob);