diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2004-01-09 17:28:47 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2004-01-09 17:28:47 (GMT) |
commit | c1f83b0515c646d3d963df09ef7d77eb7c7ce648 (patch) | |
tree | 5bb68b416254a112d869d3c599b85049bf7765b7 /Source | |
parent | 5e3b39178b9b62b460fa478b35b852b2825aa948 (diff) | |
download | CMake-c1f83b0515c646d3d963df09ef7d77eb7c7ce648.zip CMake-c1f83b0515c646d3d963df09ef7d77eb7c7ce648.tar.gz CMake-c1f83b0515c646d3d963df09ef7d77eb7c7ce648.tar.bz2 |
ENH: add a local target for libraries as well as executables
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator.cxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 8df2be5..84635ea 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -1178,11 +1178,25 @@ void cmLocalUnixMakefileGenerator::OutputLibraryRule(std::ostream& fout, } targetFullPath = m_LibraryOutputPath + targetName; - targetFullPath = this->ConvertToRelativeOutputPath(targetFullPath.c_str()); this->OutputMakeRule(fout, comment, targetFullPath.c_str(), depend.c_str(), 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, @@ -1325,8 +1339,7 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout, target = this->ConvertToRelativeOutputPath(target.c_str()); cmSystemTools::ConvertToUnixSlashes(target); bool needsLocalTarget = false; - unsigned int startPos = 0; - if(target.find('/', startPos) != target.npos) + if(target.find('/', 0) != target.npos) { needsLocalTarget = true; } |