BUG: handle case insensitive library extensions on windows

This commit is contained in:
Bill Hoffman 2005-04-08 12:46:56 -04:00
parent a5be6b8406
commit ba58264abe
2 changed files with 29 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#include "cmOrderLinkDirectories.h"
#include "cmSystemTools.h"
#include "cmsys/RegularExpression.hxx"
#include <ctype.h>
//-------------------------------------------------------------------
@ -78,6 +78,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()
{
@ -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("(.*)");

View File

@ -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;