ENH: Even better. Only replace when path longer than 20 characters. Also replace parent directory. That way it will replace for related projects.

This commit is contained in:
Andy Cedilnik 2003-12-18 18:04:49 -05:00
parent b3c7fe02a3
commit dad738eab1
1 changed files with 25 additions and 22 deletions

View File

@ -1016,6 +1016,9 @@ int cmCTest::BuildDirectory()
}
int cc;
if ( m_DartConfiguration["SourceDirectory"].size() > 20 ||
m_DartConfiguration["BuildDirectory"].size() > 20 )
{
std::string srcdir = m_DartConfiguration["SourceDirectory"] + "/";
std::string bindir = m_DartConfiguration["BuildDirectory"] + "/";
std::string srcdirrep;
@ -1026,6 +1029,7 @@ int cmCTest::BuildDirectory()
{
srcdirrep = srcdir.c_str() + cc;
srcdirrep = "/..." + srcdirrep;
srcdir = srcdir.substr(0, cc+1);
break;
}
}
@ -1035,15 +1039,14 @@ int cmCTest::BuildDirectory()
{
bindirrep = bindir.c_str() + cc;
bindirrep = "/..." + bindirrep;
bindir = bindir.substr(0, cc+1);
break;
}
}
//std::cout << "Use " << srcdirrep.c_str() << std::endl;
//std::cout << "Use " << bindirrep.c_str() << std::endl;
cmSystemTools::ReplaceString(output, srcdir.c_str(), srcdirrep.c_str());
cmSystemTools::ReplaceString(output, bindir.c_str(), bindirrep.c_str());
cmSystemTools::ReplaceString(output, srcdir.c_str(), "/.../"); //srcdirrep.c_str());
cmSystemTools::ReplaceString(output, bindir.c_str(), "/.../"); //bindirrep.c_str());
}
// Parsing of output for errors and warnings.