[cmake-commits] king committed cmFindPathCommand.cxx 1.38 1.39

cmake-commits at cmake.org cmake-commits at cmake.org
Sun Jan 20 17:24:48 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv1013/Source

Modified Files:
	cmFindPathCommand.cxx 
Log Message:
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.


Index: cmFindPathCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPathCommand.cxx,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cmFindPathCommand.cxx	17 Jan 2008 14:02:31 -0000	1.38
+++ cmFindPathCommand.cxx	20 Jan 2008 22:24:46 -0000	1.39
@@ -101,6 +101,16 @@
     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 @@
       if(result.size() == 0)
         {
         tryPath = this->SearchPaths[k];
-        tryPath += "/";
         tryPath += this->Names[j];
         if(cmSystemTools::FileExists(tryPath.c_str()))
           {
@@ -181,7 +190,6 @@
     if(frameWorkName.size())
       {
       std::string fpath = dir;
-      fpath += "/";
       fpath += frameWorkName;
       fpath += ".framework";
       std::string intPath = fpath;
@@ -200,7 +208,7 @@
   // 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);



More information about the Cmake-commits mailing list