From 0790af3bf54f8b1fcd418fec4ff968ffa55f334c Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Mon, 20 Sep 2010 10:02:39 -0400 Subject: [PATCH 1/2] Xcode: Avoid trailing space in ARCHS list (#11244) With CMAKE_OSX_ARCHITECTURE settings such as $(ARCHS_STANDARD_32BIT), the space inserted by the for loop would confuse Xcode if quoted. In this particular example, what would be output would be: ARCHS = "$(ARCHS_STANDARD_32BIT) "; The Xcode UI does not recognize this as the built-in "Standards 32-bit" architecture setting unless the space is removed. --- Source/cmGlobalXCodeGenerator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index c63b4034d..4e9969d0b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2726,12 +2726,14 @@ void cmGlobalXCodeGenerator buildSettings->AddAttribute("SDKROOT", this->CreateString(sysroot)); std::string archString; + const char* sep = ""; for( std::vector::iterator i = this->Architectures.begin(); i != this->Architectures.end(); ++i) { + archString += sep; archString += *i; - archString += " "; + sep = " "; } buildSettings->AddAttribute("ARCHS", this->CreateString(archString.c_str())); From a8ded5338bf44173fe33e0249ab14aa3d8e7540c Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sat, 18 Sep 2010 14:18:12 +0200 Subject: [PATCH 2/2] Xcode: Quote string values containing '$' (#11244) Allow use of $(STANDARD_32BIT_ARCHS) as CMAKE_OSX_ARCHITECTURES. The expanded value must remain a single string. --- Source/cmXCodeObject.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 07c7b8cf1..592047031 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -236,7 +236,7 @@ void cmXCodeObject::PrintString(std::ostream& os) const // considered special by the Xcode project file parser. bool needQuote = (this->String.empty() || - this->String.find_first_of(" <>.+-=@") != this->String.npos); + this->String.find_first_of(" <>.+-=@$") != this->String.npos); const char* quote = needQuote? "\"" : ""; // Print the string, quoted and escaped as necessary.