[Cmake-commits] [cmake-commits] david.cole committed cmGlobalXCodeGenerator.cxx 1.218 1.219

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jul 22 11:14:30 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv13980/Source

Modified Files:
	cmGlobalXCodeGenerator.cxx 
Log Message:
BUG: Fix issue #8481 - generate Xcode projects such that breakpoints may be used from the Xcode debugger without adjusting any settings within the Xcode GUI first... Thanks to Doug Gregor for the patch.


Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.218
retrieving revision 1.219
diff -C 2 -d -r1.218 -r1.219
*** cmGlobalXCodeGenerator.cxx	10 Jul 2009 20:51:44 -0000	1.218
--- cmGlobalXCodeGenerator.cxx	22 Jul 2009 15:14:23 -0000	1.219
***************
*** 673,676 ****
--- 673,693 ----
                                    dir, file);
  
+   // Try to make the path relative to the project root.
+   bool Absolute = true;
+   if (this->XcodeVersion >= 30)
+     {
+     std::string relative = 
+       this->CurrentLocalGenerator->Convert(sf->GetFullPath().c_str(), 
+                                            cmLocalGenerator::HOME,
+                                            cmLocalGenerator::MAKEFILE, 
+                                            false);
+     relative = cmSystemTools::ConvertToOutputPath(relative.c_str());
+     if (!relative.empty() && relative[0] != '/') 
+       {
+       Absolute = false;
+       path = relative;
+       }
+     }
+ 
    fileRef->AddAttribute("name", this->CreateString(file.c_str()));
    fileRef->AddAttribute("path", this->CreateString(path.c_str()));
***************
*** 683,690 ****
      fileRef->AddAttribute("sourceTree", this->CreateString("<group>"));
      }
!   else
      {
      fileRef->AddAttribute("sourceTree", this->CreateString("<absolute>"));
      }
  
    return fileRef;
--- 700,711 ----
      fileRef->AddAttribute("sourceTree", this->CreateString("<group>"));
      }
!   else if (Absolute)
      {
      fileRef->AddAttribute("sourceTree", this->CreateString("<absolute>"));
      }
+   else
+     {
+     fileRef->AddAttribute("sourceTree", this->CreateString("SOURCE_ROOT"));
+     }
  
    return fileRef;
***************
*** 2582,2587 ****
    std::string proot = root->GetMakefile()->GetCurrentDirectory();
    proot = this->ConvertToRelativeForXCode(proot.c_str());
!   this->RootObject->AddAttribute("projectRoot",
!                                  this->CreateString(proot.c_str()));
    }
    cmXCodeObject* configlist = 
--- 2603,2618 ----
    std::string proot = root->GetMakefile()->GetCurrentDirectory();
    proot = this->ConvertToRelativeForXCode(proot.c_str());
!   if (this->XcodeVersion >= 30) 
!     {
!     this->RootObject->AddAttribute("projectRoot",
!                                    this->CreateString(""));
!     this->RootObject->AddAttribute("projectDirPath",
!                                    this->CreateString(proot.c_str()));
!     }
!   else
!     {
!     this->RootObject->AddAttribute("projectRoot",
!                                    this->CreateString(proot.c_str()));
!     }
    }
    cmXCodeObject* configlist = 



More information about the Cmake-commits mailing list