diff options
author | John Biddiscombe <jbiddiscombe@skippingmouse.co.uk> | 2001-09-12 01:45:35 (GMT) |
---|---|---|
committer | John Biddiscombe <jbiddiscombe@skippingmouse.co.uk> | 2001-09-12 01:45:35 (GMT) |
commit | 7adaefb40346c133fadcf2c1c37780e5e051bb61 (patch) | |
tree | e1e6210a561935d99424285285e999c60b411595 /Source | |
parent | 288287b3364363196c1150265ad3ec8b80b6aee4 (diff) | |
download | CMake-7adaefb40346c133fadcf2c1c37780e5e051bb61.zip CMake-7adaefb40346c133fadcf2c1c37780e5e051bb61.tar.gz CMake-7adaefb40346c133fadcf2c1c37780e5e051bb61.tar.bz2 |
ERR: Change to EscapeSpaces forces rework of Borland generator <sigh>
Add clause to prevent adding quotes when they're already present, then stuff them
onto all lib paths to prevent forward slashes causing trouble.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmBorlandMakefileGenerator.cpp | 29 | ||||
-rw-r--r-- | Source/cmBorlandMakefileGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 12 |
3 files changed, 31 insertions, 12 deletions
diff --git a/Source/cmBorlandMakefileGenerator.cpp b/Source/cmBorlandMakefileGenerator.cpp index a37022c..0511926 100644 --- a/Source/cmBorlandMakefileGenerator.cpp +++ b/Source/cmBorlandMakefileGenerator.cpp @@ -98,13 +98,22 @@ void cmBorlandMakefileGenerator::RecursiveGenerateCacheOnly() mf->GenerateMakefile(); } // CLEAN up the makefiles created - for (unsigned int i=0; i<makefiles.size(); ++i) + for (unsigned int i=0; i<makefiles.size(); ++i) { delete makefiles[i]; } } //--------------------------------------------------------------------------- -void cmBorlandMakefileGenerator::OutputMakefile(const char* file) +// Add quotes regardless of spaces in the string +std::string cmBorlandMakefileGenerator::EscapeSpaces(const char* str) +{ + std::string temp = "\"";; + temp += str; + temp += "\""; + return cmSystemTools::EscapeSpaces(temp.c_str()); +} + +void cmBorlandMakefileGenerator::OutputMakefile(const char* file) { // // Create sub directories for aux source directories @@ -200,10 +209,10 @@ void cmBorlandMakefileGenerator::OutputMakefile(const char* file) i!=includes.end(); ++i) { std::string include = *i; - fout << "-I" << cmSystemTools::EscapeSpaces(i->c_str()) << "; \\\n "; + fout << "-I" << cmBorlandMakefileGenerator::EscapeSpaces(i->c_str()) << "; \\\n "; } fout << "-I" << - cmSystemTools::EscapeSpaces(m_Makefile->GetStartDirectory()) << "\n\n"; + cmBorlandMakefileGenerator::EscapeSpaces(m_Makefile->GetStartDirectory()) << "\n\n"; // // for each target add to the list of targets // @@ -282,7 +291,7 @@ void cmBorlandMakefileGenerator::OutputMakefile(const char* file) fout << "LINK_DIR ="; for (std::vector<std::string>::const_iterator d=linkdirs.begin(); d!=linkdirs.end(); d++) { - std::string temp = cmSystemTools::EscapeSpaces(d->c_str()); + std::string temp = cmBorlandMakefileGenerator::EscapeSpaces(d->c_str()); fout << temp << ";"; } fout << "\n\n"; @@ -332,7 +341,7 @@ void cmBorlandMakefileGenerator::OutputMakefile(const char* file) { libname = "$(OUTDIRLIB)\\" + libname; } - fout << " \\\n " << cmSystemTools::EscapeSpaces(libname.c_str()); + fout << " \\\n " << cmBorlandMakefileGenerator::EscapeSpaces(libname.c_str()); } } fout << "\n\n"; @@ -372,7 +381,7 @@ void cmBorlandMakefileGenerator::OutputMakefile(const char* file) { libname = "$(OUTDIRLIB)\\" + libname + ".bpi"; } - fout << " \\\n " << cmSystemTools::EscapeSpaces(libname.c_str()); + fout << " \\\n " << cmBorlandMakefileGenerator::EscapeSpaces(libname.c_str()); } } fout << "\n\n"; @@ -650,7 +659,7 @@ void cmBorlandMakefileGenerator::OutputCustomRules(std::ostream& fout) commandFiles.m_Depends.begin(); d != commandFiles.m_Depends.end(); ++d) { - std::string dep = cmSystemTools::EscapeSpaces(d->c_str()); + std::string dep = cmBorlandMakefileGenerator::EscapeSpaces(d->c_str()); fout << " " << dep.c_str(); } fout << "\n\t" << command.c_str() << "\n\n"; @@ -660,14 +669,14 @@ void cmBorlandMakefileGenerator::OutputCustomRules(std::ostream& fout) commandFiles.m_Outputs.begin(); output != commandFiles.m_Outputs.end(); ++output) { - std::string src = cmSystemTools::EscapeSpaces(source.c_str()); + std::string src = cmBorlandMakefileGenerator::EscapeSpaces(source.c_str()); fout << output->c_str() << ": " << src.c_str(); // Write out all the dependencies for this rule. for(std::set<std::string>::const_iterator d = commandFiles.m_Depends.begin(); d != commandFiles.m_Depends.end(); ++d) { - std::string dep = cmSystemTools::EscapeSpaces(d->c_str()); + std::string dep = cmBorlandMakefileGenerator::EscapeSpaces(d->c_str()); fout << " " << dep.c_str(); } fout << "\n\t" << command.c_str() << "\n\n"; diff --git a/Source/cmBorlandMakefileGenerator.h b/Source/cmBorlandMakefileGenerator.h index a0fa56d..f369101 100644 --- a/Source/cmBorlandMakefileGenerator.h +++ b/Source/cmBorlandMakefileGenerator.h @@ -80,6 +80,8 @@ private: const char* target, const char* depends, const char* command); + + std::string EscapeSpaces(const char* str); private: bool m_CacheOnly; bool m_Recurse; diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 795208d..fb2f297 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -345,9 +345,17 @@ std::string cmSystemTools::EscapeSpaces(const char* str) std::string temp = str; if (temp.find(" ") != std::string::npos) { - result = "\""; + // don't add quotes if they're already there + if (temp.find("\"")==std::string::npos) + { + result = "\""; + } result += cmSystemTools::HandleNetworkPaths(str); - return result+"\""; + if (temp.find("\"")==std::string::npos) + { + result += "\""; + } + return result; } return cmSystemTools::HandleNetworkPaths(str); |