BUG: fix for quotes in strings for flags #4022

This commit is contained in:
Bill Hoffman 2007-02-21 14:01:19 -05:00
parent 53c72ed6c3
commit 7a13c7affe
2 changed files with 6 additions and 4 deletions

View File

@ -1156,7 +1156,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
{ {
buildSettings->AddAttribute buildSettings->AddAttribute
("GCC_PREPROCESSOR_DEFINITIONS", ("GCC_PREPROCESSOR_DEFINITIONS",
this->CreateString("CMAKE_INTDIR=\\\\\\\"$(CONFIGURATION)\\\\\\\"")); this->CreateString("CMAKE_INTDIR=\\\\\"$(CONFIGURATION)\\\\\""));
} }
std::string extraLinkOptions; std::string extraLinkOptions;
if(target.GetType() == cmTarget::EXECUTABLE) if(target.GetType() == cmTarget::EXECUTABLE)
@ -2565,9 +2565,9 @@ std::string cmGlobalXCodeGenerator::XCodeEscapePath(const char* p)
if(ret.find(' ') != ret.npos) if(ret.find(' ') != ret.npos)
{ {
std::string t = ret; std::string t = ret;
ret = "\\\""; ret = "\"";
ret += t; ret += t;
ret += "\\\""; ret += "\"";
} }
return ret; return ret;
} }

View File

@ -190,6 +190,8 @@ void cmXCodeObject::SetString(const char* s)
this->String = "\"\""; this->String = "\"\"";
return; return;
} }
// escape quotes
cmSystemTools::ReplaceString(ss, "\"", "\\\"");
bool needQuote = false; bool needQuote = false;
this->String = ""; this->String = "";
if(ss.find_first_of(" <>.+-=") != ss.npos) if(ss.find_first_of(" <>.+-=") != ss.npos)
@ -200,7 +202,7 @@ void cmXCodeObject::SetString(const char* s)
{ {
this->String = "\""; this->String = "\"";
} }
this->String += s; this->String += ss;
if(needQuote) if(needQuote)
{ {
this->String += "\""; this->String += "\"";