diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index fd9dacd1af..5f5c1c3f80 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3409,7 +3409,14 @@ void cmGlobalXCodeGenerator::AppendFlag(std::string& flags, { if(*c == '\'') { - flags += "\\\\'"; + if (this->XcodeVersion >= 40) + { + flags += "'\\\\''"; + } + else + { + flags += "\\\\'"; + } } else if(*c == '\\') {