summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2003-12-23 20:01:10 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2003-12-23 20:01:10 (GMT)
commit09ba0a0a31ccc019020092f8cd219e26fb44fa03 (patch)
treec8d3ca8762fbeb9f0d977b1e4ac069e369aaa484 /Source/cmLocalGenerator.cxx
parent79c23436d3a0cf90140684c876a358d225810efb (diff)
downloadCMake-09ba0a0a31ccc019020092f8cd219e26fb44fa03.zip
CMake-09ba0a0a31ccc019020092f8cd219e26fb44fa03.tar.gz
CMake-09ba0a0a31ccc019020092f8cd219e26fb44fa03.tar.bz2
BUG: keep more of the case information
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx67
1 files changed, 53 insertions, 14 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 66357f5..1de7379 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -73,11 +73,6 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p)
m_CurrentOutputDirectory = m_Makefile->GetCurrentOutputDirectory();
m_HomeOutputDirectory = m_Makefile->GetHomeOutputDirectory();
m_HomeDirectory = m_Makefile->GetHomeDirectory();
-#if defined(_WIN32) || defined(__APPLE__)
- m_CurrentOutputDirectory = cmSystemTools::LowerCase(m_CurrentOutputDirectory);
- m_HomeOutputDirectory = cmSystemTools::LowerCase(m_HomeOutputDirectory);
- m_HomeDirectory = cmSystemTools::LowerCase(m_HomeDirectory);
-#endif
if(m_RelativePathToSourceDir.size() == 0)
{
m_RelativePathToSourceDir = cmSystemTools::RelativePath(
@@ -102,16 +97,53 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p)
// Do the work of converting to a relative path
std::string pathIn = p;
+ std::string ret = pathIn;
+ if(m_CurrentOutputDirectory.size() <= ret.size())
+ {
+ std::string sub = ret.substr(0, m_CurrentOutputDirectory.size());
+ if(
#if defined(_WIN32) || defined(__APPLE__)
- pathIn = cmSystemTools::LowerCase(pathIn);
+ cmSystemTools::LowerCase(sub) ==
+ cmSystemTools::LowerCase(m_CurrentOutputDirectory)
+#else
+ sub == m_CurrentOutputDirectory
#endif
-
- std::string ret = pathIn;
- cmSystemTools::ReplaceString(ret, m_CurrentOutputDirectory.c_str(), "");
- cmSystemTools::ReplaceString(ret, m_HomeDirectory.c_str(),
- m_RelativePathToSourceDir.c_str());
- cmSystemTools::ReplaceString(ret, m_HomeOutputDirectory.c_str(),
- m_RelativePathToBinaryDir.c_str());
+ )
+ {
+ ret = ret.substr(m_CurrentOutputDirectory.size(), ret.npos);
+ }
+ }
+ if(m_HomeDirectory.size() <= ret.size())
+ {
+ std::string sub = ret.substr(0, m_HomeDirectory.size());
+ if(
+#if defined(_WIN32) || defined(__APPLE__)
+ cmSystemTools::LowerCase(sub) ==
+ cmSystemTools::LowerCase(m_HomeDirectory)
+#else
+ sub == m_HomeDirectory
+#endif
+ )
+ {
+ ret = m_RelativePathToSourceDir + ret.substr(m_HomeDirectory.size(), ret.npos);
+ }
+ }
+ if(m_HomeOutputDirectory.size() <= ret.size())
+ {
+ std::string sub = ret.substr(0, m_HomeOutputDirectory.size());
+ if(
+#if defined(_WIN32) || defined(__APPLE__)
+ cmSystemTools::LowerCase(sub) ==
+ cmSystemTools::LowerCase(m_HomeOutputDirectory)
+#else
+ sub == m_HomeOutputDirectory
+#endif
+ )
+ {
+ ret = m_RelativePathToBinaryDir + ret.substr(m_HomeOutputDirectory.size(), ret.npos);
+ }
+ }
+
std::string relpath = m_RelativePathToBinaryDir;
if(relpath.size())
{
@@ -121,7 +153,14 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p)
{
relpath = ".";
}
- if(ret == m_HomeOutputDirectoryNoSlash)
+ if(
+#if defined(_WIN32) || defined(__APPLE__)
+ cmSystemTools::LowerCase(ret) ==
+ cmSystemTools::LowerCase(m_HomeOutputDirectoryNoSlash)
+#else
+ ret == m_HomeOutputDirectoryNoSlash
+#endif
+ )
{
ret = relpath;
}