summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPathCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-20 22:24:46 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-20 22:24:46 (GMT)
commitc7b844ba3e03aee882a8b629885ca49ecc06c146 (patch)
tree7f0332f5fa5f304a9b45370c17023c751938e474 /Source/cmFindPathCommand.cxx
parent9de44ef28a99f45069205d39026896bfcaac2ba5 (diff)
downloadCMake-c7b844ba3e03aee882a8b629885ca49ecc06c146.zip
CMake-c7b844ba3e03aee882a8b629885ca49ecc06c146.tar.gz
CMake-c7b844ba3e03aee882a8b629885ca49ecc06c146.tar.bz2
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 f322b43..53531dd 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);