[Cmake-commits] [cmake-commits] hoffman committed cmListFileCache.cxx 1.38 1.39 cmMakefile.cxx 1.455 1.456 cmMakefile.h 1.228 1.229 cmPolicies.cxx 1.17 1.18 cmake.h 1.102 1.103

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Mar 11 10:29:59 EDT 2008


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

Modified Files:
	cmListFileCache.cxx cmMakefile.cxx cmMakefile.h cmPolicies.cxx 
	cmake.h 
Log Message:
ENH: add enum to IssueMessage


Index: cmake.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.h,v
retrieving revision 1.102
retrieving revision 1.103
diff -C 2 -d -r1.102 -r1.103
*** cmake.h	4 Mar 2008 14:16:33 -0000	1.102
--- cmake.h	11 Mar 2008 14:29:56 -0000	1.103
***************
*** 59,62 ****
--- 59,69 ----
  {
   public:
+   enum MessageType
+   { AUTHOR_WARNING,
+     FATAL_ERROR,
+     MESSAGE,
+     WARNING,
+     LOG
+   };
    typedef std::map<cmStdString, cmCommand*> RegisteredCommandsMap;
  

Index: cmListFileCache.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListFileCache.cxx,v
retrieving revision 1.38
retrieving revision 1.39
diff -C 2 -d -r1.38 -r1.39
*** cmListFileCache.cxx	7 Mar 2008 20:30:33 -0000	1.38
--- cmListFileCache.cxx	11 Mar 2008 14:29:53 -0000	1.39
***************
*** 147,151 ****
        {
          case cmPolicies::WARN:
!           mf->IssueWarning(
              mf->GetPolicies()->GetPolicyWarning(cmPolicies::CMP_0000)
              );
--- 147,151 ----
        {
          case cmPolicies::WARN:
!           mf->IssueMessage(cmake::AUTHOR_WARNING,
              mf->GetPolicies()->GetPolicyWarning(cmPolicies::CMP_0000)
              );
***************
*** 156,160 ****
            break; 
          default:
!           mf->IssueError(
              mf->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0000)
              );
--- 156,160 ----
            break; 
          default:
!           mf->IssueMessage(cmake::FATAL_ERROR,
              mf->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0000)
              );

Index: cmPolicies.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmPolicies.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -C 2 -d -r1.17 -r1.18
*** cmPolicies.cxx	8 Mar 2008 14:13:13 -0000	1.17
--- cmPolicies.cxx	11 Mar 2008 14:29:56 -0000	1.18
***************
*** 203,208 ****
    // it is an error if the policy version is less than 2.4
    if (majorVer < 2 || majorVer == 2 && minorVer < 4)
!   {
!     mf->IssueError(
        "An attempt was made to set the policy version of CMake to something "
        "earlier than \"2.4\".  "
--- 203,208 ----
    // it is an error if the policy version is less than 2.4
    if (majorVer < 2 || majorVer == 2 && minorVer < 4)
!     {
!     mf->IssueMessage(cmake::FATAL_ERROR,
        "An attempt was made to set the policy version of CMake to something "
        "earlier than \"2.4\".  "
***************
*** 214,218 ****
        "One way to so this is to set the policy version to 2.4 exactly."
        );
!   }
  
    // now loop over all the policies and set them as appropriate
--- 214,218 ----
        "One way to so this is to set the policy version to 2.4 exactly."
        );
!     }
  
    // now loop over all the policies and set them as appropriate

Index: cmMakefile.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.h,v
retrieving revision 1.228
retrieving revision 1.229
diff -C 2 -d -r1.228 -r1.229
*** cmMakefile.h	7 Mar 2008 13:40:36 -0000	1.228
--- cmMakefile.h	11 Mar 2008 14:29:55 -0000	1.229
***************
*** 26,29 ****
--- 26,30 ----
  #include "cmSystemTools.h"
  #include "cmTarget.h"
+ #include "cmake.h"
  
  #if defined(CMAKE_BUILD_WITH_CMAKE)
***************
*** 785,791 ****
    void RaiseScope(const char *var, const char *value);
  
!   /** Issue messages with the given text plus context information.  */
!   void IssueWarning(std::string const& msg) const;
!   void IssueError(std::string const& msg) const;
  
  protected:
--- 786,791 ----
    void RaiseScope(const char *var, const char *value);
  
!   void IssueMessage(cmake::MessageType t,
!                     std::string const& text) const;
  
  protected:
***************
*** 892,897 ****
    friend class cmMakefileCall;
  
-   void IssueMessage(std::string const& text, bool isError) const;
- 
    cmTarget* FindBasicTarget(const char* name);
    std::vector<cmTarget*> ImportedTargetsOwned;
--- 892,895 ----

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.455
retrieving revision 1.456
diff -C 2 -d -r1.455 -r1.456
*** cmMakefile.cxx	10 Mar 2008 19:41:07 -0000	1.455
--- cmMakefile.cxx	11 Mar 2008 14:29:54 -0000	1.456
***************
*** 283,306 ****
  }
  
- //----------------------------------------------------------------------------
- void cmMakefile::IssueError(std::string const& msg) const
- {
-   this->IssueMessage(msg, true);
- }
  
  //----------------------------------------------------------------------------
! void cmMakefile::IssueWarning(std::string const& msg) const
! {
!   this->IssueMessage(msg, false);
! }
! 
! //----------------------------------------------------------------------------
! void cmMakefile::IssueMessage(std::string const& text, bool isError) const
  {
    cmOStringStream msg;
! 
    // Construct the message header.
!   if(isError)
      {
      msg << "CMake Error:";
      }
--- 283,296 ----
  }
  
  
  //----------------------------------------------------------------------------
! void cmMakefile::IssueMessage(cmake::MessageType t, std::string const& text) const
  {
    cmOStringStream msg;
!   bool isError = false;
    // Construct the message header.
!   if(t == cmake::FATAL_ERROR)
      {
+     isError = true;
      msg << "CMake Error:";
      }
***************
*** 440,444 ****
            {
            // The command invocation requested that we report an error.
!           this->IssueError(pcmd->GetError());
            }
          result = false;
--- 430,434 ----
            {
            // The command invocation requested that we report an error.
!           this->IssueMessage(cmake::FATAL_ERROR, pcmd->GetError());
            }
          result = false;
***************
*** 460,464 ****
        error += pcmd->GetName();
        error += "() is not scriptable";
!       this->IssueError(error);
        result = false;
        cmSystemTools::SetFatalErrorOccured();
--- 450,454 ----
        error += pcmd->GetName();
        error += "() is not scriptable";
!       this->IssueMessage(cmake::FATAL_ERROR, error);
        result = false;
        cmSystemTools::SetFatalErrorOccured();
***************
*** 472,476 ****
        error += lff.Name;
        error += "\".";
!       this->IssueError(error);
        result = false;
        cmSystemTools::SetFatalErrorOccured();
--- 462,466 ----
        error += lff.Name;
        error += "\".";
!       this->IssueMessage(cmake::FATAL_ERROR, error);
        result = false;
        cmSystemTools::SetFatalErrorOccured();
***************
*** 620,624 ****
        if(endScopeNicely)
          {
!         this->IssueError("cmake_policy PUSH without matching POP");
          }
        this->PopPolicy(false);
--- 610,614 ----
        if(endScopeNicely)
          {
!         this->IssueMessage(cmake::FATAL_ERROR, "cmake_policy PUSH without matching POP");
          }
        this->PopPolicy(false);
***************
*** 3261,3265 ****
          {
          case cmPolicies::WARN:
!           this->IssueWarning(this->GetPolicies()->
                               GetPolicyWarning(cmPolicies::CMP_0002));
          case cmPolicies::OLD:
--- 3251,3255 ----
          {
          case cmPolicies::WARN:
!           this->IssueMessage(cmake::AUTHOR_WARNING, this->GetPolicies()->
                               GetPolicyWarning(cmPolicies::CMP_0002));
          case cmPolicies::OLD:
***************
*** 3267,3271 ****
          case cmPolicies::REQUIRED_IF_USED:
          case cmPolicies::REQUIRED_ALWAYS:
!           this->IssueError(
              this->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0002)
              );
--- 3257,3261 ----
          case cmPolicies::REQUIRED_IF_USED:
          case cmPolicies::REQUIRED_ALWAYS:
!           this->IssueMessage(cmake::FATAL_ERROR,
              this->GetPolicies()->GetRequiredPolicyError(cmPolicies::CMP_0002)
              );



More information about the Cmake-commits mailing list