summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2001-06-22 15:14:32 (GMT)
committerKen Martin <ken.martin@kitware.com>2001-06-22 15:14:32 (GMT)
commit43793f7df4c540b132010eccb74b73cf010eb60a (patch)
treea93b9da3a78d29eec5fede01957ce426ae854ed2 /Source
parentb977136904223e1763414527683ff4a4891a5549 (diff)
downloadCMake-43793f7df4c540b132010eccb74b73cf010eb60a.zip
CMake-43793f7df4c540b132010eccb74b73cf010eb60a.tar.gz
CMake-43793f7df4c540b132010eccb74b73cf010eb60a.tar.bz2
added escape quotes option in replace strings
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx15
-rw-r--r--Source/cmMakefile.h1
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index acd18c8..210007b 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -752,19 +752,30 @@ int cmMakefile::DumpDocumentationToFile(const char *fileName)
void cmMakefile::ExpandVariablesInString(std::string& source) const
{
+ this->ExpandVariablesInString(source, false);
+}
+
+void cmMakefile::ExpandVariablesInString(std::string& source,
+ bool escapeQuotes) const
+{
for(DefinitionMap::const_iterator i = m_Definitions.begin();
i != m_Definitions.end(); ++i)
{
+ std::string replace = (*i).second;
+ if (escapeQuotes)
+ {
+ replace = cmSystemTools::EscapeQuotes(replace.c_str());
+ }
std::string variable = "${";
variable += (*i).first;
variable += "}";
cmSystemTools::ReplaceString(source, variable.c_str(),
- (*i).second.c_str());
+ replace.c_str());
variable = "@";
variable += (*i).first;
variable += "@";
cmSystemTools::ReplaceString(source, variable.c_str(),
- (*i).second.c_str());
+ replace.c_str());
}
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d430f04..5c13889 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -451,6 +451,7 @@ public:
* expanded to match autoconf style expansions.
*/
void ExpandVariablesInString(std::string& source) const;
+ void ExpandVariablesInString(std::string& source, bool escapeQuotes) const;
/**
* Remove any remaining variables in the string. Anything with ${var} or