From 7a13c7affe6ecdfda9ef4df1d5f9c7d039e922e0 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 21 Feb 2007 14:01:19 -0500 Subject: [PATCH] BUG: fix for quotes in strings for flags #4022 --- Source/cmGlobalXCodeGenerator.cxx | 6 +++--- Source/cmXCodeObject.cxx | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index a9f004582..e87fb22e1 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1156,7 +1156,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target, { buildSettings->AddAttribute ("GCC_PREPROCESSOR_DEFINITIONS", - this->CreateString("CMAKE_INTDIR=\\\\\\\"$(CONFIGURATION)\\\\\\\"")); + this->CreateString("CMAKE_INTDIR=\\\\\"$(CONFIGURATION)\\\\\"")); } std::string extraLinkOptions; if(target.GetType() == cmTarget::EXECUTABLE) @@ -2565,9 +2565,9 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p) if(ret.find(' ') != ret.npos) { std::string t = ret; - ret = "\\\""; + ret = "\""; ret += t; - ret += "\\\""; + ret += "\""; } return ret; } diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 37d51a56a..de0602547 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -190,6 +190,8 @@ void cmXCodeObject::SetString(const char* s) this->String = "\"\""; return; } + // escape quotes + cmSystemTools::ReplaceString(ss, "\"", "\\\""); bool needQuote = false; this->String = ""; if(ss.find_first_of(" <>.+-=") != ss.npos) @@ -200,7 +202,7 @@ void cmXCodeObject::SetString(const char* s) { this->String = "\""; } - this->String += s; + this->String += ss; if(needQuote) { this->String += "\"";