Browse Source

ENH: fix a few more xcode things

Bill Hoffman 21 years ago
parent
commit
e2ff9a73fa
2 changed files with 20 additions and 6 deletions
  1. 2 2
      Source/cmGlobalXCodeGenerator.cxx
  2. 18 4
      Source/cmXCodeObject.cxx

+ 2 - 2
Source/cmGlobalXCodeGenerator.cxx

@@ -113,11 +113,11 @@ cmGlobalXCodeGenerator::CreateXCodeSourceFile(cmLocalGenerator* lg,
   cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
   cmXCodeObject* settings = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
   buildFile->AddAttribute("settings", settings);
   buildFile->AddAttribute("settings", settings);
   fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
   fileRef->AddAttribute("fileEncoding", this->CreateString("4"));
-  fileRef->AddAttribute("lastKnownFileType", this->CreateString("sourcecode.cpp.cpp;"));
+  fileRef->AddAttribute("lastKnownFileType", this->CreateString("sourcecode.cpp.cpp"));
   fileRef->AddAttribute("path", this->CreateString(
   fileRef->AddAttribute("path", this->CreateString(
     lg->ConvertToRelativeOutputPath(sf->GetFullPath().c_str()).c_str()));
     lg->ConvertToRelativeOutputPath(sf->GetFullPath().c_str()).c_str()));
   fileRef->AddAttribute("refType", this->CreateString("4"));
   fileRef->AddAttribute("refType", this->CreateString("4"));
-  fileRef->AddAttribute("sourceTree", this->CreateString("<group>"));
+  fileRef->AddAttribute("sourceTree", this->CreateString("\"<group>\""));
   return buildFile;
   return buildFile;
 }
 }
 
 

+ 18 - 4
Source/cmXCodeObject.cxx

@@ -50,14 +50,14 @@ void cmXCodeObject::Print(std::ostream& out)
       }
       }
     else if(object->m_Type == OBJECT_LIST)
     else if(object->m_Type == OBJECT_LIST)
       {
       {
-      out << i->first << " = {\n";
+      out << i->first << " = (\n";
       for(unsigned int k = 0; k < i->second->m_List.size(); k++)
       for(unsigned int k = 0; k < i->second->m_List.size(); k++)
         {
         {
         cmXCodeObject::Indent(4, out);
         cmXCodeObject::Indent(4, out);
         out << i->second->m_List[k]->m_Id << ",\n";
         out << i->second->m_List[k]->m_Id << ",\n";
         } 
         } 
       cmXCodeObject::Indent(3, out);
       cmXCodeObject::Indent(3, out);
-      out << "};\n";
+      out << ");\n";
       }
       }
     else if(object->m_Type == ATTRIBUTE_GROUP)
     else if(object->m_Type == ATTRIBUTE_GROUP)
       {
       {
@@ -66,7 +66,14 @@ void cmXCodeObject::Print(std::ostream& out)
       for(j = object->m_ObjectAttributes.begin(); j != object->m_ObjectAttributes.end(); ++j)
       for(j = object->m_ObjectAttributes.begin(); j != object->m_ObjectAttributes.end(); ++j)
         {
         {
         cmXCodeObject::Indent(4, out);
         cmXCodeObject::Indent(4, out);
-        out << j->first << " = " << j->second->m_String << ";\n";
+        if(object->m_String.size() )
+          {
+          out << j->first << " = " << j->second->m_String << ";\n";
+          }
+        else
+          {
+          out << j->first << " = " << "\"\";\n";
+          }
         }
         }
       cmXCodeObject::Indent(3, out);
       cmXCodeObject::Indent(3, out);
       out << "};\n";
       out << "};\n";
@@ -77,7 +84,14 @@ void cmXCodeObject::Print(std::ostream& out)
       }
       }
     else if(object->m_Type == STRING)
     else if(object->m_Type == STRING)
       {
       {
-      out << i->first << " = " << object->m_String << ";\n";
+      if(object->m_String.size() )
+        {
+        out << i->first << " = " << object->m_String << ";\n";
+        }
+      else
+        {
+        out << i->first << " = " << "\"\";\n";
+        }
       }
       }
     else
     else
       {
       {