summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2005-04-08 16:46:56 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2005-04-08 16:46:56 (GMT)
commitba58264abe0ce3274c593180d41c58a23d99d694 (patch)
treec60912593057e913f7bc9f59f994a00650a176f0 /Source
parenta5be6b84067dc3fcc10088e5d003610f46d2b1f5 (diff)
downloadCMake-ba58264abe0ce3274c593180d41c58a23d99d694.zip
CMake-ba58264abe0ce3274c593180d41c58a23d99d694.tar.gz
CMake-ba58264abe0ce3274c593180d41c58a23d99d694.tar.bz2
BUG: handle case insensitive library extensions on windows
Diffstat (limited to 'Source')
-rw-r--r--Source/cmOrderLinkDirectories.cxx29
-rw-r--r--Source/cmOrderLinkDirectories.h1
2 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmOrderLinkDirectories.cxx b/Source/cmOrderLinkDirectories.cxx
index 5c98b82..5082b8f 100644
--- a/Source/cmOrderLinkDirectories.cxx
+++ b/Source/cmOrderLinkDirectories.cxx
@@ -1,7 +1,7 @@
#include "cmOrderLinkDirectories.h"
#include "cmSystemTools.h"
#include "cmsys/RegularExpression.hxx"
-
+#include <ctype.h>
//-------------------------------------------------------------------
@@ -79,6 +79,29 @@ void cmOrderLinkDirectories::FindIndividualLibraryOrders()
}
//-------------------------------------------------------------------
+std::string cmOrderLinkDirectories::NoCaseExpression(const char* str)
+{
+ std::string ret;
+ const char* s = str;
+ while(*s)
+ {
+ if(*s == '.')
+ {
+ ret += *s;
+ }
+ else
+ {
+ ret += "[";
+ ret += tolower(*s);
+ ret += toupper(*s);
+ ret += "]";
+ }
+ s++;
+ }
+ return ret;
+}
+
+//-------------------------------------------------------------------
void cmOrderLinkDirectories::CreateRegularExpressions()
{
cmStdString libext = "(";
@@ -92,7 +115,11 @@ void cmOrderLinkDirectories::CreateRegularExpressions()
}
first = false;
libext += "\\";
+#ifndef _WIN32
libext += *i;
+#else
+ libext += this->NoCaseExpression(i->c_str());
+#endif
}
libext += ").*";
cmStdString reg("(.*)");
diff --git a/Source/cmOrderLinkDirectories.h b/Source/cmOrderLinkDirectories.h
index 61e3823..7d807f2 100644
--- a/Source/cmOrderLinkDirectories.h
+++ b/Source/cmOrderLinkDirectories.h
@@ -98,6 +98,7 @@ private:
std::map<cmStdString, std::vector<cmStdString> >& m);
void OrderPaths(std::vector<cmStdString>& paths);
bool FindPathNotInDirectoryToAfterList(cmStdString& path);
+ std::string NoCaseExpression(const char* str);
private:
// map from library to directories that it is in other than its full path
std::map<cmStdString, std::vector<cmStdString> > m_LibraryToDirectories;