[Cmake-commits] [cmake-commits] king committed cmDocumentationFormatterText.cxx 1.4 1.5 cmMakefile.cxx 1.449 1.450

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 7 16:01:24 EST 2008


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

Modified Files:
	cmDocumentationFormatterText.cxx cmMakefile.cxx 
Log Message:
ENH: In cmMakefile::IssueMessage use cmDocumentationFormatterText to format the message nicely.


Index: cmDocumentationFormatterText.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentationFormatterText.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmDocumentationFormatterText.cxx	22 Oct 2007 16:48:39 -0000	1.4
--- cmDocumentationFormatterText.cxx	7 Mar 2008 21:01:22 -0000	1.5
***************
*** 70,74 ****
    for(const char* ptr = text; *ptr; ++ptr)
      {
!     if(newline)
        {
        os << this->TextIndent;
--- 70,74 ----
    for(const char* ptr = text; *ptr; ++ptr)
      {
!     if(newline && *ptr != '\n')
        {
        os << this->TextIndent;

Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.449
retrieving revision 1.450
diff -C 2 -d -r1.449 -r1.450
*** cmMakefile.cxx	7 Mar 2008 20:30:33 -0000	1.449
--- cmMakefile.cxx	7 Mar 2008 21:01:22 -0000	1.450
***************
*** 36,39 ****
--- 36,41 ----
  #include <stdlib.h> // required for atoi
  
+ #include "cmDocumentationFormatterText.h"
+ 
  #include <cmsys/RegularExpression.hxx>
  
***************
*** 282,311 ****
  
  //----------------------------------------------------------------------------
- // Helper function to print a block of text with every line following
- // a given prefix.
- void cmMakefilePrintPrefixed(std::ostream& os,  const char* prefix,
-                              std::string const& msg)
- {
-   bool newline = true;
-   for(const char* c = msg.c_str(); *c; ++c)
-     {
-     if(newline && *c != '\n')
-       {
-       os << prefix;
-       newline = false;
-       }
-     os << *c;
-     if(*c == '\n')
-       {
-       newline = true;
-       }
-     }
-   if(!newline)
-     {
-     os << "\n";
-     }
- }
- 
- //----------------------------------------------------------------------------
  void cmMakefile::IssueError(std::string const& msg) const
  {
--- 284,287 ----
***************
*** 352,358 ****
  
    // Add the message text.
    msg << " {\n";
!   cmMakefilePrintPrefixed(msg, "  ", text);
    msg << "}";
  
    // Add the rest of the context.
--- 328,338 ----
  
    // Add the message text.
+   {
    msg << " {\n";
!   cmDocumentationFormatterText formatter;
!   formatter.SetIndent("  ");
!   formatter.PrintFormatted(msg, text.c_str());
    msg << "}";
+   }
  
    // Add the rest of the context.
***************
*** 3304,3308 ****
          }
        e << "created in source directory \""
!         << existing->GetMakefile()->GetCurrentDirectory() << "\".\n"
          << "\n";
        e <<
--- 3284,3288 ----
          }
        e << "created in source directory \""
!         << existing->GetMakefile()->GetCurrentDirectory() << "\"."
          << "\n";
        e <<
***************
*** 3317,3321 ****
          "targets with the same physical name while keeping logical "
          "names distinct.  "
!         "Custom targets must simply have globally unique names.\n"
          "\n"
          "If you are building an older project it is possible that "
--- 3297,3301 ----
          "targets with the same physical name while keeping logical "
          "names distinct.  "
!         "Custom targets must simply have globally unique names."
          "\n"
          "If you are building an older project it is possible that "
***************
*** 3325,3329 ****
          {
          e <<
-           "\n"
            "For projects that care only about Makefile generators and do "
            "not wish to support Xcode or VS IDE generators, one may add\n"
--- 3305,3308 ----



More information about the Cmake-commits mailing list