From ba58264abe0ce3274c593180d41c58a23d99d694 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 8 Apr 2005 12:46:56 -0400 Subject: BUG: handle case insensitive library extensions on windows --- Source/cmOrderLinkDirectories.cxx | 29 ++++++++++++++++++++++++++++- Source/cmOrderLinkDirectories.h | 1 + 2 files changed, 29 insertions(+), 1 deletion(-) 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 //------------------------------------------------------------------- @@ -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 >& m); void OrderPaths(std::vector& 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 > m_LibraryToDirectories; -- cgit v0.12