summaryrefslogtreecommitdiffstats
path: root/Source/cmFindLibraryCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-20 22:41:14 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-20 22:41:14 (GMT)
commit9f982d7d39a92fa1164a6e3f653dbce17ca38ad7 (patch)
tree7cef6ddd927fba0ebc3ac8a7790fbfb82635b127 /Source/cmFindLibraryCommand.cxx
parentc7b844ba3e03aee882a8b629885ca49ecc06c146 (diff)
downloadCMake-9f982d7d39a92fa1164a6e3f653dbce17ca38ad7.zip
CMake-9f982d7d39a92fa1164a6e3f653dbce17ca38ad7.tar.gz
CMake-9f982d7d39a92fa1164a6e3f653dbce17ca38ad7.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. This file was left out of the previous checkin for this problem.
Diffstat (limited to 'Source/cmFindLibraryCommand.cxx')
-rw-r--r--Source/cmFindLibraryCommand.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index bae60c4..e7cfbeb 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -181,6 +181,16 @@ std::string cmFindLibraryCommand::FindLibrary(const char* name)
std::vector<std::string> suffixes;
cmSystemTools::ExpandListArgument(prefixes_list, prefixes, true);
cmSystemTools::ExpandListArgument(suffixes_list, suffixes, true);
+ // 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 += "/";
+ }
+ }
std::string tryPath;
for(std::vector<std::string>::const_iterator p = this->SearchPaths.begin();
p != this->SearchPaths.end(); ++p)
@@ -188,7 +198,6 @@ std::string cmFindLibraryCommand::FindLibrary(const char* name)
if(supportFrameworks)
{
tryPath = *p;
- tryPath += "/";
tryPath += name;
tryPath += ".framework";
if(cmSystemTools::FileExists(tryPath.c_str())
@@ -209,7 +218,6 @@ std::string cmFindLibraryCommand::FindLibrary(const char* name)
suffix != suffixes.end(); ++suffix)
{
tryPath = *p;
- tryPath += "/";
tryPath += *prefix;
tryPath += name;
tryPath += *suffix;