[Cmake-commits] CMake branch, next, updated. v2.8.12.1-6862-gdb23a89

Brad King brad.king at kitware.com
Wed Jan 8 11:23:48 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  db23a893869d483fae8dd502147b20aeeca826b1 (commit)
       via  b17729460ba66ec96ad0a79dd52c0557e81a895f (commit)
      from  db76715f7592f1e885e4ec9a10cc1a677255a9f6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=db23a893869d483fae8dd502147b20aeeca826b1
commit db23a893869d483fae8dd502147b20aeeca826b1
Merge: db76715 b177294
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 8 11:23:47 2014 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jan 8 11:23:47 2014 -0500

    Merge topic 'compat-help-custom-modules' into next
    
    b177294 cmake: Implement placeholder --help-custom-modules compatibility


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b17729460ba66ec96ad0a79dd52c0557e81a895f
commit b17729460ba66ec96ad0a79dd52c0557e81a895f
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jan 8 11:14:06 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jan 8 11:16:48 2014 -0500

    cmake: Implement placeholder --help-custom-modules compatibility
    
    The implementation of the "cmake --help-custom-modules" was removed
    along with the rest of the old help generation infrastructure when
    documentation was converted to reStructuredText.  In order to avoid
    breaking existing project builds outright when they use a custom command
    that runs a command like "cmake --help-custom-modules foo.1", generate
    the requested file with placeholder content explaining that the option
    is not supported anymore.

diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 01f7a20..9c27fc1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -138,6 +138,8 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
       return this->PrintHelpListPolicies(os);
     case cmDocumentation::Version:
       return this->PrintVersion(os);
+    case cmDocumentation::OldCustomModules:
+      return this->PrintOldCustomModules(os);
     default: return false;
     }
 }
@@ -336,7 +338,15 @@ bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
       GET_OPT_ARGUMENT(help.Filename);
       cmSystemTools::Message(
         "Warning: --help-custom-modules no longer supported");
-      return true;
+      if(help.Filename.empty())
+        {
+        return true;
+        }
+      // Avoid breaking old project builds completely by at least generating
+      // the output file.  Abuse help.Argument to give the file name to
+      // PrintOldCustomModules without disrupting our internal API.
+      help.HelpType = cmDocumentation::OldCustomModules;
+      help.Argument = cmSystemTools::GetFilenameName(help.Filename);
       }
     else if(strcmp(argv[i], "--help-commands") == 0)
       {
@@ -864,3 +874,48 @@ bool cmDocumentation::IsOption(const char* arg) const
   return ((arg[0] == '-') || (strcmp(arg, "/V") == 0) ||
           (strcmp(arg, "/?") == 0));
 }
+
+//----------------------------------------------------------------------------
+bool cmDocumentation::PrintOldCustomModules(std::ostream& os)
+{
+  // CheckOptions abuses the Argument field to give us the file name.
+  std::string filename = this->CurrentArgument;
+  std::string ext = cmSystemTools::UpperCase(
+    cmSystemTools::GetFilenameLastExtension(filename));
+  std::string name = cmSystemTools::GetFilenameWithoutLastExtension(filename);
+
+  const char* summary = "cmake --help-custom-modules no longer supported\n";
+  const char* detail =
+    "CMake versions prior to 3.0 exposed their internal module help page\n"
+    "generation functionality through the --help-custom-modules option.\n"
+    "CMake versions 3.0 and above use other means to generate their module\n"
+    "help pages so this functionality is no longer available to be exposed.\n"
+    "\n"
+    "This file was generated as a placeholder to provide this information.\n"
+    ;
+  if((ext == ".HTM") || (ext == ".HTML"))
+    {
+    os << "<html><title>" << name << "</title><body>\n"
+       << summary << "<p/>\n" << detail << "</body></html>\n";
+    }
+  else if((ext.length()==2) && (ext[1] >='1') && (ext[1]<='9'))
+    {
+    os <<
+      ".TH " << name << " " << ext[1] << " \"" <<
+      cmSystemTools::GetCurrentDateTime("%B %d, %Y") <<
+      "\" \"cmake " << cmVersion::GetCMakeVersion() << "\"\n"
+      ".SH NAME\n"
+      ".PP\n" <<
+      name << " \\- " << summary <<
+      "\n"
+      ".SH DESCRIPTION\n"
+      ".PP\n" <<
+      detail
+      ;
+    }
+  else
+    {
+    os << name << "\n\n" << summary << "\n" << detail;
+    }
+  return true;
+}
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 05c0442..d5a7dd5 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -115,6 +115,7 @@ private:
   bool PrintHelpListVariables(std::ostream& os);
   bool PrintHelpListPolicies(std::ostream& os);
   bool PrintDocumentationUsage(std::ostream& os);
+  bool PrintOldCustomModules(std::ostream& os);
 
   const char* GetNameString() const;
   bool IsOption(const char* arg) const;
diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h
index c7da52c..118f03d 100644
--- a/Source/cmDocumentationFormatter.h
+++ b/Source/cmDocumentationFormatter.h
@@ -28,7 +28,8 @@ public:
   {
     None, Version, Usage, ListManuals,
     ListCommands, ListModules, ListProperties, ListVariables, ListPolicies,
-    OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy
+    OneManual, OneCommand, OneModule, OneProperty, OneVariable, OnePolicy,
+    OldCustomModules
   };
 };
 

-----------------------------------------------------------------------

Summary of changes:
 Source/cmDocumentation.cxx        |   57 ++++++++++++++++++++++++++++++++++++-
 Source/cmDocumentation.h          |    1 +
 Source/cmDocumentationFormatter.h |    3 +-
 3 files changed, 59 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list