From ae69928e69b81a08272ff5eb53a94f198d4952e1 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 30 Dec 2003 08:41:04 -0500 Subject: [PATCH] BUG: borland make treats ./target and target as different also convert to outputpathrelative may get passed a quoted path --- Source/cmLocalGenerator.cxx | 10 +++++++--- Source/cmLocalUnixMakefileGenerator.cxx | 12 +++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 32f09524f..e3454bafc 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -106,13 +106,16 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p) // Do the work of converting to a relative path std::string pathIn = p; - bool ispath = false; if(pathIn.find('/') == pathIn.npos) { return pathIn; } - + if(pathIn.size() && pathIn[0] == '\"') + { + pathIn = pathIn.substr(1, pathIn.size()-2); + } + std::string ret = pathIn; if(m_CurrentOutputDirectory.size() <= ret.size()) { @@ -180,7 +183,8 @@ std::string cmLocalGenerator::ConvertToRelativeOutputPath(const char* p) { ret = relpath; } - if(ret.size() && ret[0] != '/' && ret[0] != '.') + if(ret.size() + && ret[0] != '\"' && ret[0] != '/' && ret[0] != '.') { if(ret.size() > 1 && ret[1] != ':') { diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 08b017770..af4ddf631 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -1323,11 +1323,21 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout, target += name; target += cmSystemTools::GetExecutableExtension(); target = this->ConvertToRelativeOutputPath(target.c_str()); + cmSystemTools::ConvertToUnixSlashes(target); bool needsLocalTarget = false; - if(target.find('/', 2) != target.npos) + unsigned int startPos = 2; + 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) { needsLocalTarget = true; } + target = cmSystemTools::ConvertToOutputPath(target.c_str()); + std::string objs = "$(" + this->CreateMakeVariable(name, "_SRC_OBJS") + ") "; std::string depend = "$(";