[Cmake-commits] [cmake-commits] alex committed cmExtraEclipseCDT4Generator.h 1.12 1.13 cmExtraEclipseCDT4Generator.cxx 1.29 1.30

cmake-commits at cmake.org cmake-commits at cmake.org
Sun Nov 22 05:01:06 EST 2009


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

Modified Files:
	cmExtraEclipseCDT4Generator.h cmExtraEclipseCDT4Generator.cxx 
Log Message:
improve system/compiler specific settings of Eclipse

-use CMAKE_EXECUTABLE_FORMAT and CMAKE_SYSTEM_NAME to decide which binary
parsers to load (ELF/Mach O/PE)
-use CMAKE_(C|CXX)_COMPILER_ID to load the respective compiler error parser
-remove EclipseToolchainType, which was a mixture between compiler and operating system

Alex


Index: cmExtraEclipseCDT4Generator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C 2 -d -r1.12 -r1.13
*** cmExtraEclipseCDT4Generator.h	28 Sep 2009 15:42:28 -0000	1.12
--- cmExtraEclipseCDT4Generator.h	22 Nov 2009 10:01:04 -0000	1.13
***************
*** 57,72 ****
    void CreateCProjectFile() const;
  
-   // Eclipse supported toolchain types
-   enum EclipseToolchainType
-     {
-     EclipseToolchainOther,
-     EclipseToolchainLinux,
-     EclipseToolchainCygwin,
-     EclipseToolchainMinGW,
-     EclipseToolchainSolaris,
-     EclipseToolchainMacOSX
-     };
-   static EclipseToolchainType GetToolChainType(const cmMakefile& makefile);
- 
    // If built with cygwin cmake, convert posix to windows path.
    static std::string GetEclipsePath(const std::string& path);
--- 57,60 ----

Index: cmExtraEclipseCDT4Generator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExtraEclipseCDT4Generator.cxx,v
retrieving revision 1.29
retrieving revision 1.30
diff -C 2 -d -r1.29 -r1.30
*** cmExtraEclipseCDT4Generator.cxx	20 Oct 2009 21:14:12 -0000	1.29
--- cmExtraEclipseCDT4Generator.cxx	22 Nov 2009 10:01:04 -0000	1.30
***************
*** 286,293 ****
      "\t\t\t\t\t<value>"
      ;
!   if (this->GetToolChainType(*mf) == EclipseToolchainOther)
      {
      fout << "org.eclipse.cdt.core.VCErrorParser;";
      }
    fout <<
      "org.eclipse.cdt.core.MakeErrorParser;"
--- 286,302 ----
      "\t\t\t\t\t<value>"
      ;
!   std::string compilerId = mf->GetSafeDefinition("CMAKE_C_COMPILER_ID");
!   if (compilerId.empty())  // no C compiler, try the C++ compiler:
!     {
!     compilerId = mf->GetSafeDefinition("CMAKE_CXX_COMPILER_ID");
!     }
!   if (compilerId == "MSVC")
      {
      fout << "org.eclipse.cdt.core.VCErrorParser;";
      }
+   else if (compilerId == "Intel")
+     {
+     fout << "org.eclipse.cdt.core.ICCErrorParser;";
+     }
    fout <<
      "org.eclipse.cdt.core.MakeErrorParser;"
***************
*** 419,436 ****
      ;
    // TODO: refactor this out...
!   switch (this->GetToolChainType(*mf))
!   {
!     case EclipseToolchainLinux   :
!       fout << "<extension id=\"org.eclipse.cdt.core.ELF\""
!               " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
!               ;
!       fout << "<extension id=\"org.eclipse.cdt.core.GNU_ELF\""
!               " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
!               "<attribute key=\"addr2line\" value=\"addr2line\"/>\n"
!               "<attribute key=\"c++filt\" value=\"c++filt\"/>\n"
!               "</extension>\n"
!               ;
!       break;
!     case EclipseToolchainCygwin  :
        fout << "<extension id=\"org.eclipse.cdt.core.Cygwin_PE\""
                " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
--- 428,450 ----
      ;
    // TODO: refactor this out...
!   std::string executableFormat = mf->GetSafeDefinition(
!                                                     "CMAKE_EXECUTABLE_FORMAT");
!   if (executableFormat == "ELF")
!     {
!     fout << "<extension id=\"org.eclipse.cdt.core.ELF\""
!             " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
!             ;
!     fout << "<extension id=\"org.eclipse.cdt.core.GNU_ELF\""
!             " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
!             "<attribute key=\"addr2line\" value=\"addr2line\"/>\n"
!             "<attribute key=\"c++filt\" value=\"c++filt\"/>\n"
!             "</extension>\n"
!             ;
!     }
!   else
!     {
!     std::string systemName = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
!     if (systemName == "CYGWIN")
!       {
        fout << "<extension id=\"org.eclipse.cdt.core.Cygwin_PE\""
                " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
***************
*** 441,456 ****
                "</extension>\n"
                ;
!       break;
!     case EclipseToolchainMinGW   :
        fout << "<extension id=\"org.eclipse.cdt.core.PE\""
                " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
                ;
!       break;
!     case EclipseToolchainSolaris :
!       fout << "<extension id=\"org.eclipse.cdt.core.ELF\""
!               " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
!               ;
!       break;
!     case EclipseToolchainMacOSX  :
        fout << "<extension id=\"org.eclipse.cdt.core.MachO\""
                " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
--- 455,467 ----
                "</extension>\n"
                ;
!       }
!     else if (systemName == "Windows")
!       {
        fout << "<extension id=\"org.eclipse.cdt.core.PE\""
                " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
                ;
!       }
!     else if (systemName == "Darwin")
!       {
        fout << "<extension id=\"org.eclipse.cdt.core.MachO\""
                " point=\"org.eclipse.cdt.core.BinaryParser\">\n"
***************
*** 458,474 ****
                "</extension>\n"
                ;
!       break;
!     case EclipseToolchainOther   :
!       fout << "<extension id=\"org.eclipse.cdt.core.PE\""
!               " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
!               ;
!       fout << "<extension id=\"org.eclipse.cdt.core.ELF\""
!               " point=\"org.eclipse.cdt.core.BinaryParser\"/>\n"
!               ;
!       break;
!     default      :
        // *** Should never get here ***
        fout << "<error_toolchain_type/>\n";
!   }
    fout << "</extensions>\n"
            "</storageModule>\n"
--- 469,480 ----
                "</extension>\n"
                ;
!       }
!     else
!       {
        // *** Should never get here ***
        fout << "<error_toolchain_type/>\n";
!       }
!     }
! 
    fout << "</extensions>\n"
            "</storageModule>\n"
***************
*** 829,866 ****
  
  //----------------------------------------------------------------------------
- cmExtraEclipseCDT4Generator::EclipseToolchainType
- cmExtraEclipseCDT4Generator::GetToolChainType(const cmMakefile& makefile)
- {
-   if (makefile.IsSet("UNIX"))
-     {
-     if (makefile.IsSet("CYGWIN"))
-       {
-       return EclipseToolchainCygwin;
-       }
-     if (makefile.IsSet("APPLE" ))
-       {
-       return EclipseToolchainMacOSX;
-       }
-     // *** how do I determine if it is Solaris ???
-     return EclipseToolchainLinux;
-     }
-   else if (makefile.IsSet("WIN32"))
-     {
-     if (makefile.IsSet("MINGW"))
-       {
-       return EclipseToolchainMinGW;
-       }
-     if (makefile.IsSet("MSYS" ))
-       {
-       return EclipseToolchainMinGW;
-       }
-     return EclipseToolchainOther;
-     }
-   else
-     {
-     return EclipseToolchainOther;
-     }
- }
- 
  std::string
  cmExtraEclipseCDT4Generator::GetEclipsePath(const std::string& path)
--- 835,838 ----



More information about the Cmake-commits mailing list