Xcode: Refine quoting rules for Strings

$ and . do not need to be quoted, but brackets and * must be to
not confuse the Xcode parser.
This commit is contained in:
Gregor Jasny 2015-04-09 11:04:35 +02:00
parent a6331eb851
commit 6693590f81
2 changed files with 3 additions and 3 deletions

View File

@ -243,7 +243,7 @@ void cmXCodeObject::PrintString(std::ostream& os,std::string String)
bool needQuote = bool needQuote =
(String.empty() || (String.empty() ||
String.find("//") != String.npos || String.find("//") != String.npos ||
String.find_first_of(" <>.+-=@$[],") != String.npos); String.find_first_of(" <>+-*=@[](){},") != String.npos);
const char* quote = needQuote? "\"" : ""; const char* quote = needQuote? "\"" : "";
// Print the string, quoted and escaped as necessary. // Print the string, quoted and escaped as necessary.

View File

@ -1,6 +1,6 @@
set(expect-default "explicitFileType = sourcecode") set(expect-default "explicitFileType = sourcecode")
set(expect-explicit "explicitFileType = \"sourcecode.c.h\"") set(expect-explicit "explicitFileType = sourcecode.c.h")
set(expect-lastKnown "lastKnownFileType = \"sourcecode.c.h\"") set(expect-lastKnown "lastKnownFileType = sourcecode.c.h")
foreach(src default explicit lastKnown) foreach(src default explicit lastKnown)
file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeFileType.xcodeproj/project.pbxproj actual-${src} file(STRINGS ${RunCMake_TEST_BINARY_DIR}/XcodeFileType.xcodeproj/project.pbxproj actual-${src}
REGEX "PBXFileReference.*src-${src}") REGEX "PBXFileReference.*src-${src}")