From e31f93ea3fbf71c0bfcce168dbed9d9c0ff22029 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 9 Feb 2006 17:29:58 -0500 Subject: BUG: Deal with case insensitivity on windows linker paths. Also fixed spelling typo. --- Source/cmOrderLinkDirectories.cxx | 19 +++++++++++++++---- Source/cmOrderLinkDirectories.h | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Source/cmOrderLinkDirectories.cxx b/Source/cmOrderLinkDirectories.cxx index b3362ef..add18d7 100644 --- a/Source/cmOrderLinkDirectories.cxx +++ b/Source/cmOrderLinkDirectories.cxx @@ -212,7 +212,7 @@ void cmOrderLinkDirectories::OrderPaths(std::vector& = m_DirectoryToAfterList.begin(); i != m_DirectoryToAfterList.end(); ++i) { - m_ImposibleDirectories.insert(i->first); + m_ImpossibleDirectories.insert(i->first); // still put it in the path list in the order we find them orderedPaths.push_back(i->first); } @@ -297,6 +297,17 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder() { cmSystemTools::SplitProgramPath(m_RawLinkItems[i].c_str(), dir, file); +#ifdef _WIN32 + // Avoid case problems for windows paths. + if(dir.size() > 2 && dir[1] == ':') + { + if(dir[0] >= 'A' && dir[0] <= 'Z') + { + dir[0] += 'a' - 'A'; + } + } + dir = cmSystemTools::GetActualCaseForPath(dir.c_str()); +#endif m_DirectoryToAfterList[dir] = empty; m_LinkPathSet.insert(dir); aLib.FullPath = m_RawLinkItems[i]; @@ -336,7 +347,7 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder() // now turn libfoo.a into foo and foo.a into foo // This will prepare the link items for -litem this->PrepareLinkTargets(); - if(m_ImposibleDirectories.size()) + if(m_ImpossibleDirectories.size()) { cmSystemTools::Message(this->GetWarnings().c_str()); return false; @@ -347,8 +358,8 @@ bool cmOrderLinkDirectories::DetermineLibraryPathOrder() std::string cmOrderLinkDirectories::GetWarnings() { std::string warning = "It is impossible to order the linker search path in such a way that libraries specified as full paths will be picked by the linker.\nDirectories and libraries involved are:\n"; - for(std::set::iterator i = m_ImposibleDirectories.begin(); - i != m_ImposibleDirectories.end(); ++i) + for(std::set::iterator i = m_ImpossibleDirectories.begin(); + i != m_ImpossibleDirectories.end(); ++i) { warning += "Directory: "; warning += *i; diff --git a/Source/cmOrderLinkDirectories.h b/Source/cmOrderLinkDirectories.h index 88f6e16..3a82a19 100644 --- a/Source/cmOrderLinkDirectories.h +++ b/Source/cmOrderLinkDirectories.h @@ -137,7 +137,7 @@ private: // the names of link prefixes cmStdString m_LinkPrefix; // set of directories that can not be put in the correct order - std::set m_ImposibleDirectories; + std::set m_ImpossibleDirectories; // Name of target cmStdString m_TargetName; // library regular expressions -- cgit v0.12