[cmake-commits] martink committed cmDocumentation.cxx 1.56 1.57 cmDocumentation.h 1.29 1.30 cmDocumentationSection.cxx 1.1 1.2 cmDocumentationSection.h 1.1 1.2 cmakemain.cxx 1.70 1.71

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Oct 22 15:33:21 EDT 2007


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

Modified Files:
	cmDocumentation.cxx cmDocumentation.h 
	cmDocumentationSection.cxx cmDocumentationSection.h 
	cmakemain.cxx 
Log Message:
COMP: fix some warnings and add some doc strings back in


Index: cmDocumentation.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.cxx,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- cmDocumentation.cxx	22 Oct 2007 16:48:39 -0000	1.56
+++ cmDocumentation.cxx	22 Oct 2007 19:33:19 -0000	1.57
@@ -104,71 +104,6 @@
 };
 
 //----------------------------------------------------------------------------
-static const char *cmDocumentationCommandsHeader[][3] =
-{
-  {0,
-   "The following commands are available in CMakeLists.txt code:", 0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationGlobalPropertiesHeader[][3] =
-{
-  {0,
-   "The following global properties are available in CMakeLists.txt code:", 0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationDirectoryPropertiesHeader[][3] =
-{
-  {0
-   ,"The following directory properties are available in CMakeLists.txt code:"
-   ,0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationTargetPropertiesHeader[][3] =
-{
-  {0,
-   "The following target properties are available in CMakeLists.txt code:", 0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationTestPropertiesHeader[][3] =
-{
-  {0
-   ,"The following properties for tests are available in CMakeLists.txt code:"
-   ,0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationSourceFilePropertiesHeader[][3] =
-{
-  {0
-  ,"The following source file properties are available in CMakeLists.txt code:"
-  , 0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationVariablePropertiesHeader[][3] =
-{
-  {0, "The following variables are available in CMakeLists.txt code:", 0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
-static const char *cmDocumentationCachedVariablePropertiesHeader[][3] =
-{
-  {0,"The following cache variables are available in CMakeLists.txt code:", 0},
-  {0,0,0}
-};
-
-//----------------------------------------------------------------------------
 static const char *cmDocumentationModulesHeader[][3] =
 {
   {0,
@@ -288,6 +223,18 @@
   sec = new cmDocumentationSection("See Also","SEE ALSO");
   sec->Append(cmDocumentationStandardSeeAlso);
   this->AllSections["Standard See Also"] = sec;  
+
+  sec = new cmDocumentationSection("Options","OPTIONS");
+  sec->Append(cmDocumentationStandardOptions);
+  this->AllSections["Options"] = sec;  
+
+  sec = new cmDocumentationSection("Properties","PROPERTIES");
+  sec->Append(cmPropertiesDocumentationDescription);
+  this->AllSections["Properties Description"] = sec;  
+
+  sec = new cmDocumentationSection("Generators","GENERATORS");
+  sec->Append(cmDocumentationGeneratorsHeader);
+  this->AllSections["Generators"] = sec;  
 }
 
 //----------------------------------------------------------------------------
@@ -298,6 +245,12 @@
     {
     delete [] *i;
     }
+  for(std::map<std::string,cmDocumentationSection *>::iterator i = 
+        this->AllSections.begin();
+      i != this->AllSections.end(); ++i)
+    {
+    delete i->second;
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -375,6 +328,7 @@
       this->PrintDocumentationList(os,"Modules");
       return true;
     case cmDocumentation::PropertyList: 
+      this->PrintDocumentationList(os,"Properties Description");
       this->PrintDocumentationList(os,"Properties of Global Scope");
       this->PrintDocumentationList(os,"Properties on Directories");
       this->PrintDocumentationList(os,"Properties on Targets");
@@ -414,7 +368,8 @@
   dir.Load(cmakeModules.c_str());
   if (dir.GetNumberOfFiles() > 0)
     {
-    this->AllSections["Modules"]->Append(cmDocumentationModulesHeader[0]);
+    sec->Append(cmDocumentationModulesHeader[0]);
+    sec->Append(cmModulesDocumentationDescription);
     this->CreateModuleDocsForDir(dir, *this->AllSections["Modules"]);
     }
   return true;
@@ -442,6 +397,7 @@
           new cmDocumentationSection("Custom CMake Modules","CUSTOM MODULES");
         this->AllSections["Custom CMake Modules"] = sec;
         sec->Append(cmDocumentationCustomModulesHeader[0]);
+        sec->Append(cmCustomModulesDocumentationDescription);
         sectionHasHeader = true;
         }
       this->CreateModuleDocsForDir
@@ -856,6 +812,63 @@
 }
 
 //----------------------------------------------------------------------------
+void cmDocumentation::PrependSection(const char *name, 
+                                     const char *docs[][3])
+{
+  cmDocumentationSection *sec = 0;
+  if (this->AllSections.find(name) == this->AllSections.end())
+    {
+    cmDocumentationSection *sec = 
+      new cmDocumentationSection(name, 
+                                 cmSystemTools::UpperCase(name).c_str());
+    this->SetSection(name,sec);
+    }
+  else
+    {
+    sec = this->AllSections[name];
+    }
+  sec->Prepend(docs);
+}
+
+//----------------------------------------------------------------------------
+void cmDocumentation::AppendSection(const char *name, 
+                                    const char *docs[][3])
+{
+  cmDocumentationSection *sec = 0;
+  if (this->AllSections.find(name) == this->AllSections.end())
+    {
+    cmDocumentationSection *sec = 
+      new cmDocumentationSection(name, 
+                                 cmSystemTools::UpperCase(name).c_str());
+    this->SetSection(name,sec);
+    }
+  else
+    {
+    sec = this->AllSections[name];
+    }
+  sec->Append(docs);
+}
+
+//----------------------------------------------------------------------------
+void cmDocumentation::AppendSection(const char *name, 
+                                    std::vector<cmDocumentationEntry> &docs)
+{
+  cmDocumentationSection *sec = 0;
+  if (this->AllSections.find(name) == this->AllSections.end())
+    {
+    cmDocumentationSection *sec = 
+      new cmDocumentationSection(name, 
+                                 cmSystemTools::UpperCase(name).c_str());
+    this->SetSection(name,sec);
+    }
+  else
+    {
+    sec = this->AllSections[name];
+    }
+  sec->Append(docs);
+}
+
+//----------------------------------------------------------------------------
 void cmDocumentation::SetSeeAlsoList(const char *data[][3])
 {
   cmDocumentationSection *sec = 

Index: cmDocumentation.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentation.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- cmDocumentation.h	22 Oct 2007 16:48:39 -0000	1.29
+++ cmDocumentation.h	22 Oct 2007 19:33:19 -0000	1.30
@@ -73,6 +73,14 @@
   void SetSections(std::map<std::string,cmDocumentationSection *>
                    &sections);
 
+  /** Add the documentation to the beginning/end of the section */
+  void PrependSection(const char *sectionName,
+                      const char *docs[][3]);
+  void AppendSection(const char *sectionName,
+                     const char *docs[][3]);
+  void AppendSection(const char *sectionName,
+                     std::vector<cmDocumentationEntry> &docs);
+
   /**
    * Print documentation in the given form.  All previously added
    * sections will be generated.

Index: cmakemain.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmakemain.cxx,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- cmakemain.cxx	22 Oct 2007 16:48:39 -0000	1.70
+++ cmakemain.cxx	22 Oct 2007 19:33:19 -0000	1.71
@@ -300,9 +300,9 @@
 
     std::vector<cmDocumentationEntry> commands;
     std::vector<cmDocumentationEntry> compatCommands;
+    std::vector<cmDocumentationEntry> generators;
     std::map<std::string,cmDocumentationSection *> propDocs;
 
-    std::vector<cmDocumentationEntry> generators;
     hcm.GetCommandDocumentation(commands, true, false);
     hcm.GetCommandDocumentation(compatCommands, false, true);
     hcm.GetPropertiesDocumentation(propDocs);
@@ -312,8 +312,8 @@
     doc.SetSection("Name",cmDocumentationName);
     doc.SetSection("Usage",cmDocumentationUsage);
     doc.SetSection("Description",cmDocumentationDescription);
-    doc.SetSection("Generators",generators);
-    doc.SetSection("Options",cmDocumentationOptions);
+    doc.AppendSection("Generators",generators);
+    doc.PrependSection("Options",cmDocumentationOptions);
     doc.SetSection("Commands",commands);
     doc.SetSection("Compatibility Commands",compatCommands);
     doc.SetSections(propDocs);

Index: cmDocumentationSection.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentationSection.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cmDocumentationSection.cxx	22 Oct 2007 16:49:09 -0000	1.1
+++ cmDocumentationSection.cxx	22 Oct 2007 19:33:19 -0000	1.2
@@ -31,6 +31,21 @@
 }
 
 //----------------------------------------------------------------------------
+void cmDocumentationSection::Prepend(const char *data[][3])
+{
+  std::vector<cmDocumentationEntry> tmp;
+  int i = 0;
+  while(data[i][1])
+    {
+    tmp.push_back(cmDocumentationEntry(data[i][0],
+                                       data[i][1],
+                                       data[i][2]));
+    data += 1;
+    }
+  this->Entries.insert(this->Entries.begin(),tmp.begin(),tmp.end());
+}
+
+//----------------------------------------------------------------------------
 void cmDocumentationSection::Append(const char *n, const char *b,
                                     const char *f)
 {

Index: cmDocumentationSection.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmDocumentationSection.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cmDocumentationSection.h	22 Oct 2007 16:49:09 -0000	1.1
+++ cmDocumentationSection.h	22 Oct 2007 19:33:19 -0000	1.2
@@ -56,11 +56,10 @@
   /** Append an entry to this section using NULL terminated chars */
   void Append(const char *[][3]);
   void Append(const char *n, const char *b, const char *f);
-  
-  /** Set the contents of this section. */
-//  void Set(const std::vector<cmDocumentationEntry> header,
-//           const std::vector<cmDocumentationEntry> section,
-//           const std::vector<cmDocumentationEntry> footer);
+
+  /** prepend some documentation to this section */
+  void Prepend(const char *[][3]);
+
   
 private:
   std::string Name;



More information about the Cmake-commits mailing list