ENH: add a local target for libraries as well as executables

This commit is contained in:
Bill Hoffman 2004-01-09 12:28:47 -05:00
parent 5e3b39178b
commit c1f83b0515
1 changed files with 16 additions and 3 deletions

View File

@ -1178,11 +1178,25 @@ void cmLocalUnixMakefileGenerator::OutputLibraryRule(std::ostream& fout,
} }
targetFullPath = m_LibraryOutputPath + targetName; targetFullPath = m_LibraryOutputPath + targetName;
targetFullPath = this->ConvertToRelativeOutputPath(targetFullPath.c_str());
this->OutputMakeRule(fout, comment, this->OutputMakeRule(fout, comment,
targetFullPath.c_str(), targetFullPath.c_str(),
depend.c_str(), depend.c_str(),
commands); commands);
depend = targetFullPath;
targetFullPath = this->ConvertToRelativeOutputPath(targetFullPath.c_str());
cmSystemTools::ConvertToUnixSlashes(targetFullPath);
if(targetFullPath.find('/', 0) != targetFullPath.npos)
{
// we need a local target
depend = this->ConvertToRelativeOutputPath(depend.c_str());
std::string target = targetName;
commands.resize(0);
this->OutputMakeRule(fout,
comment,
target.c_str(),
depend.c_str(),
commands);
}
} }
void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout, void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout,
@ -1325,8 +1339,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 = 0; if(target.find('/', 0) != target.npos)
if(target.find('/', startPos) != target.npos)
{ {
needsLocalTarget = true; needsLocalTarget = true;
} }