ENH: fix for hp make and relative paths never have targets with a ./ at the start of the name
This commit is contained in:
parent
c83f3b3c4c
commit
d1efed1415
|
@ -192,5 +192,16 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = cmSystemTools::ConvertToOutputPath(ret.c_str());
|
ret = cmSystemTools::ConvertToOutputPath(ret.c_str());
|
||||||
|
if(ret.size() > 2 &&
|
||||||
|
(ret[0] == '.') &&
|
||||||
|
( (ret[1] == '/') || ret[1] == '\\'))
|
||||||
|
{
|
||||||
|
std::string upath = ret;
|
||||||
|
cmSystemTools::ConvertToUnixSlashes(upath);
|
||||||
|
if(upath.find(2, '/') == upath.npos)
|
||||||
|
{
|
||||||
|
ret = ret.substr(2, ret.size()-2);
|
||||||
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1325,13 +1325,7 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout,
|
||||||
target = this->ConvertToRelativeOutputPath(target.c_str());
|
target = this->ConvertToRelativeOutputPath(target.c_str());
|
||||||
cmSystemTools::ConvertToUnixSlashes(target);
|
cmSystemTools::ConvertToUnixSlashes(target);
|
||||||
bool needsLocalTarget = false;
|
bool needsLocalTarget = false;
|
||||||
unsigned int startPos = 2;
|
unsigned int startPos = 0;
|
||||||
if(m_Makefile->GetDefinition("BORLAND"))
|
|
||||||
{
|
|
||||||
// the borland makefiles treat .\target and target as different
|
|
||||||
// targets. All other makes treat them the same
|
|
||||||
startPos = 0;
|
|
||||||
}
|
|
||||||
if(target.find('/', startPos) != target.npos)
|
if(target.find('/', startPos) != target.npos)
|
||||||
{
|
{
|
||||||
needsLocalTarget = true;
|
needsLocalTarget = true;
|
||||||
|
|
Loading…
Reference in New Issue