[Cmake-commits] [cmake-commits] king committed CMakeLists.txt 1.427 1.428 cmGlobalXCode21Generator.cxx 1.8 NONE cmGlobalXCode21Generator.h 1.4 NONE cmGlobalXCodeGenerator.cxx 1.226 1.227 cmGlobalXCodeGenerator.h 1.61 1.62

cmake-commits at cmake.org cmake-commits at cmake.org
Sat Sep 19 12:00:22 EDT 2009


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

Modified Files:
	CMakeLists.txt cmGlobalXCodeGenerator.cxx 
	cmGlobalXCodeGenerator.h 
Removed Files:
	cmGlobalXCode21Generator.cxx cmGlobalXCode21Generator.h 
Log Message:
Remove cmGlobalXCode21Generator subclass

This subclass of cmGlobalXCodeGenerator only provided two virtual method
overrides, and it made construction of the Xcode generator instance
complicated.  This commit removes it and replaces the virtual methods
with tests of the Xcode version.  The change removes duplicate code.


Index: cmGlobalXCodeGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.cxx,v
retrieving revision 1.226
retrieving revision 1.227
diff -C 2 -d -r1.226 -r1.227
*** cmGlobalXCodeGenerator.cxx	18 Sep 2009 14:28:28 -0000	1.226
--- cmGlobalXCodeGenerator.cxx	19 Sep 2009 16:00:06 -0000	1.227
***************
*** 16,20 ****
  =========================================================================*/
  #include "cmGlobalXCodeGenerator.h"
- #include "cmGlobalXCode21Generator.h"
  #include "cmLocalXCodeGenerator.h"
  #include "cmMakefile.h"
--- 16,19 ----
***************
*** 26,29 ****
--- 25,30 ----
  #include "cmSourceFile.h"
  
+ #include <cmsys/auto_ptr.hxx>
+ 
  //----------------------------------------------------------------------------
  #if defined(CMAKE_BUILD_WITH_CMAKE)
***************
*** 134,150 ****
    parser.ParseFile
      ("/Developer/Applications/Xcode.app/Contents/version.plist");
!   if(parser.Version == 15)
!     {
!     return new cmGlobalXCodeGenerator;
!     }
!   else if (parser.Version == 20)
      {
      cmSystemTools::Message("Xcode 2.0 not really supported by cmake, "
                             "using Xcode 15 generator\n");
-     return new cmGlobalXCodeGenerator;
      }
!   cmGlobalXCodeGenerator* ret = new cmGlobalXCode21Generator;
!   ret->SetVersion(parser.Version);
!   return ret;
  #else
    std::cerr << "CMake should be built with cmake to use XCode, "
--- 135,146 ----
    parser.ParseFile
      ("/Developer/Applications/Xcode.app/Contents/version.plist");
!   cmsys::auto_ptr<cmGlobalXCodeGenerator> gg(new cmGlobalXCodeGenerator);
!   if (parser.Version == 20)
      {
      cmSystemTools::Message("Xcode 2.0 not really supported by cmake, "
                             "using Xcode 15 generator\n");
      }
!   gg->SetVersion(parser.Version);
!   return gg.release();
  #else
    std::cerr << "CMake should be built with cmake to use XCode, "
***************
*** 2999,3004 ****
    fout << "};\n";
    cmXCodeObject::Indent(1, fout);
!   fout << "objectVersion = 39;\n";
!   cmXCodeObject::PrintList(this->XCodeObjects, fout);
    cmXCodeObject::Indent(1, fout);
    fout << "rootObject = " << this->RootObject->GetId() << ";\n";
--- 2995,3013 ----
    fout << "};\n";
    cmXCodeObject::Indent(1, fout);
!   if(this->XcodeVersion >= 21)
!     {
!     if (this->XcodeVersion >= 31)
!       fout << "objectVersion = 45;\n";
!     else if (this->XcodeVersion >= 30)
!       fout << "objectVersion = 44;\n";
!     else
!       fout << "objectVersion = 42;\n";
!     cmXCode21Object::PrintList(this->XCodeObjects, fout);
!     }
!   else
!     {
!     fout << "objectVersion = 39;\n";
!     cmXCodeObject::PrintList(this->XCodeObjects, fout);
!     }
    cmXCodeObject::Indent(1, fout);
    fout << "rootObject = " << this->RootObject->GetId() << ";\n";
***************
*** 3007,3010 ****
--- 3016,3025 ----
  
  //----------------------------------------------------------------------------
+ const char* cmGlobalXCodeGenerator::GetCMakeCFGInitDirectory()
+ {
+   return this->XcodeVersion >= 21? "$(CONFIGURATION)" : ".";
+ }
+ 
+ //----------------------------------------------------------------------------
  void cmGlobalXCodeGenerator::GetDocumentation(cmDocumentationEntry& entry)
    const

Index: cmGlobalXCodeGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGlobalXCodeGenerator.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -C 2 -d -r1.61 -r1.62
*** cmGlobalXCodeGenerator.h	29 Jul 2009 20:40:07 -0000	1.61
--- cmGlobalXCodeGenerator.h	19 Sep 2009 16:00:09 -0000	1.62
***************
*** 81,85 ****
  
    ///! What is the configurations directory variable called?
!   virtual const char* GetCMakeCFGInitDirectory()  { return "."; }
  
    void GetTargetObjectFileDirectories(cmTarget* target,
--- 81,85 ----
  
    ///! What is the configurations directory variable called?
!   virtual const char* GetCMakeCFGInitDirectory();
  
    void GetTargetObjectFileDirectories(cmTarget* target,
***************
*** 150,156 ****
    void OutputXCodeProject(cmLocalGenerator* root,
                            std::vector<cmLocalGenerator*>& generators);
!   virtual void  WriteXCodePBXProj(std::ostream& fout,
!                                   cmLocalGenerator* root,
!                                   std::vector<cmLocalGenerator*>& generators);
    cmXCodeObject* CreateXCodeFileReference(cmSourceFile* sf,
                                            cmTarget& cmtarget);
--- 150,155 ----
    void OutputXCodeProject(cmLocalGenerator* root,
                            std::vector<cmLocalGenerator*>& generators);
!   void WriteXCodePBXProj(std::ostream& fout, cmLocalGenerator* root,
!                          std::vector<cmLocalGenerator*>& generators);
    cmXCodeObject* CreateXCodeFileReference(cmSourceFile* sf,
                                            cmTarget& cmtarget);

--- cmGlobalXCode21Generator.cxx DELETED ---

Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.427
retrieving revision 1.428
diff -C 2 -d -r1.427 -r1.428
*** CMakeLists.txt	10 Sep 2009 15:16:05 -0000	1.427
--- CMakeLists.txt	19 Sep 2009 16:00:00 -0000	1.428
***************
*** 252,257 ****
      cmGlobalXCodeGenerator.cxx
      cmGlobalXCodeGenerator.h
-     cmGlobalXCode21Generator.cxx
-     cmGlobalXCode21Generator.h
      cmLocalXCodeGenerator.cxx
      cmLocalXCodeGenerator.h)
--- 252,255 ----

--- cmGlobalXCode21Generator.h DELETED ---



More information about the Cmake-commits mailing list