BUG: handle case insensitive library extensions on windows
This commit is contained in:
parent
a5be6b8406
commit
ba58264abe
|
@ -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("(.*)");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue