[Cmake-commits] CMake branch, next, updated. v2.8.7-2591-g34bf89a

David Cole david.cole at kitware.com
Tue Feb 14 16:12:01 EST 2012


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  34bf89abe4c478fd00030d31fdd2b6ac9a062f55 (commit)
       via  d4b77eba17e01badc836777dbb0c9ec287f098aa (commit)
       via  9002f73f311893be20d8d986de8e5239ed2afce2 (commit)
       via  02ccb3291bd1053df30600211b0ceefbb7fea00f (commit)
       via  24fbc28e5f81823661853be0c0acdf2670b3453e (commit)
       via  bafd8a9e79612c260af12f9a42c7e7cddf1f7da3 (commit)
       via  543f1adfa4a8f2f38371512ffcb8c252332acb18 (commit)
       via  cdbd1a9e39e79fe2f29dff3c3a7b9cf9c9fae3cc (commit)
       via  52c53deb1bc0109340479aa1284e2fa03b2f5401 (commit)
      from  3c2a66f295f8b18131c115984be3ca6af8077726 (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=34bf89abe4c478fd00030d31fdd2b6ac9a062f55
commit 34bf89abe4c478fd00030d31fdd2b6ac9a062f55
Merge: 3c2a66f d4b77eb
Author:     David Cole <david.cole at kitware.com>
AuthorDate: Tue Feb 14 16:11:55 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Feb 14 16:11:55 2012 -0500

    Merge topic 'ImproveCPackDoc-reloaded' into next
    
    d4b77eb Avoid discovering system infos for documentation. Adding some path is enough.
    9002f73 Fix non existent std::string::clear on VS6
    02ccb32 Create getDocumentedModulesListInDir which may be used in other context.
    24fbc28 Add missing section markup for CPackComponent
    bafd8a9 Example of builtin variable documentation (i.e. only used in C++ source code).
    543f1ad Make the load of script documentation more efficient and dynamic.
    cdbd1a9 Fix another compiler warning due to a typo
    52c53de Really avoid compiler warning about unused vars


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d4b77eba17e01badc836777dbb0c9ec287f098aa
commit d4b77eba17e01badc836777dbb0c9ec287f098aa
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Tue Feb 7 16:59:04 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:24 2012 -0500

    Avoid discovering system infos for documentation. Adding some path is enough.

diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 3182915..c541610 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -304,30 +304,31 @@ int main (int argc, char *argv[])
       help = false;
     }
 
-  // find out which system cpack is running on, so it can setup the search
-  // paths, so FIND_XXX() commands can be used in scripts
   // This part is used for cpack documentation lookup as well.
   cminst.AddCMakePaths();
-  std::string systemFile =
-    globalMF->GetModulesFile("CMakeDetermineSystem.cmake");
-  if (!globalMF->ReadListFile(0, systemFile.c_str()))
-    {
-    cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
-      "Error reading CMakeDetermineSystem.cmake" << std::endl);
-    return 1;
-    }
-
-  systemFile =
-    globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake");
-  if (!globalMF->ReadListFile(0, systemFile.c_str()))
-    {
-    cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
-      "Error reading CMakeSystemSpecificInformation.cmake" << std::endl);
-    return 1;
-    }
 
   if ( parsed && !help )
     {
+    // find out which system cpack is running on, so it can setup the search
+    // paths, so FIND_XXX() commands can be used in scripts
+    std::string systemFile =
+      globalMF->GetModulesFile("CMakeDetermineSystem.cmake");
+    if (!globalMF->ReadListFile(0, systemFile.c_str()))
+      {
+      cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
+        "Error reading CMakeDetermineSystem.cmake" << std::endl);
+      return 1;
+      }
+
+    systemFile =
+      globalMF->GetModulesFile("CMakeSystemSpecificInformation.cmake");
+    if (!globalMF->ReadListFile(0, systemFile.c_str()))
+      {
+      cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
+        "Error reading CMakeSystemSpecificInformation.cmake" << std::endl);
+      return 1;
+      }
+
     if ( cmSystemTools::FileExists(cpackConfigFile.c_str()) )
       {
       cpackConfigFile =

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9002f73f311893be20d8d986de8e5239ed2afce2
commit 9002f73f311893be20d8d986de8e5239ed2afce2
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Mon Feb 6 17:20:54 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:24 2012 -0500

    Fix non existent std::string::clear on VS6

diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index dde4953..02f69f1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -786,7 +786,7 @@ int cmDocumentation::getDocumentedModulesListInDir(
         // No else if no section is found (undocumented module)
         }
       // No else cannot read first line (ignore this kind of error)
-      line.clear();
+      line = "";
       }
     }
   if (nbDocumentedModules>0)
@@ -887,7 +887,7 @@ int cmDocumentation::GetStructuredDocFromFile(
                docCtxIdx++;
                docContextStack[docCtxIdx]=SDOC_SECTION;
                /* drop the rest of the line */
-               line.clear();
+               line = "";
                newCtx = true;
             }
             else if (mkword.substr(0,3)=="end")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=02ccb3291bd1053df30600211b0ceefbb7fea00f
commit 02ccb3291bd1053df30600211b0ceefbb7fea00f
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sat Feb 4 12:15:57 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:23 2012 -0500

    Create getDocumentedModulesListInDir which may be used in other context.
    
    This should makes it easier to use the same "documented module"
    techniques for CTest, CMake or user module.

diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 25a72fa..3182915 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -26,7 +26,6 @@
 #include "cmCPackLog.h"
 
 #include <cmsys/CommandLineArguments.hxx>
-#include <cmsys/Glob.hxx>
 #include <cmsys/SystemTools.hxx>
 #include <memory> // auto_ptr
 
@@ -527,68 +526,26 @@ int main (int argc, char *argv[])
 
     std::vector<cmDocumentationEntry> commands;
 
-    typedef std::pair<std::string,std::string> docModuleSectionPair_t;
-    typedef std::list<docModuleSectionPair_t>  docedModulesList_t;
-    docedModulesList_t     docedModList;
-    docModuleSectionPair_t docPair;
-    std::string            docedFile;
+    std::string                              docedFile;
+    std::string                              docPath;
+    cmDocumentation::documentedModulesList_t docedModList;
 
-    cmsys::Glob gl;
-    std::string findExpr;
-    std::vector<std::string> files;
-    std::string line;
     docedFile = globalMF->GetModulesFile("CPack.cmake");
     if (docedFile.length()!=0)
       {
-      findExpr += cmSystemTools::GetFilenamePath(docedFile.c_str());
-      findExpr += "/CPack*.cmake";
-      if (gl.FindFiles(findExpr))
-        {
-        files = gl.GetFiles();
-        for (std::vector<std::string>::iterator itf=files.begin();
-             itf!=files.end();++itf)
-          {
-          std::ifstream fin((*itf).c_str());
-          if (!fin) continue;
-          if (cmSystemTools::GetLineFromStream(fin, line))
-            {
-            if (line.find("##section")!=std::string::npos)
-              {
-              docPair.first = cmSystemTools::GetFilenameName(*itf);
-              // 10 is the size of '##section' + 1
-              docPair.second = line.substr(10,std::string::npos);
-              docedModList.push_back(docPair);
-              }
-            }
-          else
-            {
-            line.clear();
-            }
-          }
-        }
-      else
-        {
-        // build the list of files to be parsed for documentation
-        // extraction
-        docPair.first  = "CPack.cmake";
-        docPair.second = "Variables common to all CPack generators";
-        docedModList.push_back(docPair);
-        docPair.first  = "CPackComponent.cmake";
-        docedModList.push_back(docPair);
-        }
+      docPath = cmSystemTools::GetFilenamePath(docedFile.c_str());
+      doc.getDocumentedModulesListInDir(docPath,"CPack*.cmake",docedModList);
       }
 
     // parse the files for documentation.
-    for (docedModulesList_t::iterator it = docedModList.begin();
-         it!= docedModList.end(); ++it)
+    cmDocumentation::documentedModulesList_t::iterator docedIt;
+    for (docedIt = docedModList.begin();
+         docedIt!= docedModList.end(); ++docedIt)
       {
-      docedFile = globalMF->GetModulesFile((it->first).c_str());
-      if (docedFile.length()!=0)
-        {
-          doc.GetStructuredDocFromFile(docedFile.c_str(),
-                                       commands,&cminst,(it->second).c_str());
-        }
-     }
+          doc.GetStructuredDocFromFile(
+              (docedIt->first).c_str(),
+              commands,&cminst,(docedIt->second).c_str());
+      }
 
     std::map<std::string,cmDocumentationSection *> propDocs;
     cminst.GetPropertiesDocumentation(propDocs);
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index ed1e5e1..dde4953 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -14,6 +14,7 @@
 #include "cmSystemTools.h"
 #include "cmVersion.h"
 #include <cmsys/Directory.hxx>
+#include <cmsys/Glob.hxx>
 
 
 //----------------------------------------------------------------------------
@@ -745,6 +746,60 @@ void cmDocumentation::addCPackStandardDocSections()
 }
 
 //----------------------------------------------------------------------------
+int cmDocumentation::getDocumentedModulesListInDir(
+          std::string path,
+          std::string globExpr,
+          documentedModulesList_t& docedModuleList)
+{
+  cmsys::Glob gl;
+  std::string findExpr;
+  std::vector<std::string> files;
+  std::string line;
+  documentedModuleSectionPair_t docPair;
+  int nbDocumentedModules = 0;
+
+  findExpr = path + "/" + globExpr;
+  if (gl.FindFiles(findExpr))
+    {
+    files = gl.GetFiles();
+    for (std::vector<std::string>::iterator itf=files.begin();
+        itf!=files.end();++itf)
+      {
+      std::ifstream fin((*itf).c_str());
+      // file access trouble ignore it (ignore this kind of error)
+      if (!fin) continue;
+      /* read first line in order to get doc section */
+      if (cmSystemTools::GetLineFromStream(fin, line))
+        {
+        /* Doc section indicates that
+         * this file has structured doc in it.
+         */
+        if (line.find("##section")!=std::string::npos)
+          {
+          // ok found one more documented module
+          ++nbDocumentedModules;
+          docPair.first = *itf;
+          // 10 is the size of '##section' + 1
+          docPair.second = line.substr(10,std::string::npos);
+          docedModuleList.push_back(docPair);
+          }
+        // No else if no section is found (undocumented module)
+        }
+      // No else cannot read first line (ignore this kind of error)
+      line.clear();
+      }
+    }
+  if (nbDocumentedModules>0)
+    {
+    return 0;
+    }
+  else
+    {
+    return 1;
+    }
+}
+
+//----------------------------------------------------------------------------
 static void trim(std::string& s)
 {
   std::string::size_type pos = s.find_last_not_of(' ');
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 83a0a09..00dba1a 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -35,6 +35,21 @@ public:
   cmDocumentation();
   
   ~cmDocumentation();
+
+  /**
+   * An helper type pair for [structured] documented modules.
+   * The comment of those module contains structure markup
+   * which makes it possible to retrieve the documentation
+   * of variables, macros and functions defined in the module.
+   * - first is the filename of the module
+   * - second is the section of the doc the module belongs too
+   */
+  typedef std::pair<std::string,std::string> documentedModuleSectionPair_t;
+  /**
+   * A list of documented module(s).
+   */
+  typedef std::list<documentedModuleSectionPair_t>  documentedModulesList_t;
+
   // High-level interface for standard documents:
   
   /**
@@ -133,6 +148,21 @@ public:
   void addCPackStandardDocSections();
 
   /**
+   * Retrieve the list of documented module located in
+   * path which match the globing expression globExpr.
+   * @param[in] path, directory where to start the search
+   *                  we will recurse into it.
+   * @param[in] globExpr, the globing expression used to
+   *                      match the file in path.
+   * @param[out] the list of obtained pairs (may be empty)
+   * @return 0 on success 1 on error or empty list
+   */
+  int getDocumentedModulesListInDir(
+          std::string path,
+          std::string globExpr,
+          documentedModulesList_t& docModuleList);
+
+  /**
    * Get the documentation of macros, functions and variable documented
    * with CMake structured documentation in a CMake script.
    * (in fact it may be in any file which follow the structured doc format)
@@ -140,7 +170,8 @@ public:
    * ## (double sharp) in column 1 & 2 immediately followed
    * by a markup. Those ## are ignored by the legacy module
    * documentation parser @see CreateSingleModule.
-   * Current markup are ##macro, ##function, ##variable and ##end.
+   * Current markup are ##section, ##module,
+   * ##macro, ##function, ##variable and ##end.
    * ##end is closing either of the previous ones.
    * @param[in] fname the script file name to be parsed for documentation
    * @param[in,out] commands the vector of command/macros documentation

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=24fbc28e5f81823661853be0c0acdf2670b3453e
commit 24fbc28e5f81823661853be0c0acdf2670b3453e
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sat Feb 4 12:06:09 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:23 2012 -0500

    Add missing section markup for CPackComponent

diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index a0e0667..016cb8c 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -1,3 +1,6 @@
+##section Variables common to all CPack generators
+##end
+##module
 # - Build binary and source package installers
 #
 # The CPackComponent module is the module which handles
@@ -20,6 +23,7 @@
 # components are identified by the COMPONENT argument of CMake's
 # INSTALL commands, and should be further described by the following
 # CPack commands:
+##end
 #
 ##macro
 #   cpack_add_component - Describes a CPack installation component

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bafd8a9e79612c260af12f9a42c7e7cddf1f7da3
commit bafd8a9e79612c260af12f9a42c7e7cddf1f7da3
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sat Feb 4 12:03:58 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:23 2012 -0500

    Example of builtin variable documentation (i.e. only used in C++ source code).

diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index 6327152..68cde78 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -1,17 +1,25 @@
 #include "cmCPackDocumentVariables.h"
 #include "cmake.h"
 
-void cmCPackDocumentVariables::DefineVariables(cmake* )
+void cmCPackDocumentVariables::DefineVariables(cmake* cm)
 {
   // Subsection: variables defined/used by cpack,
   // which are common to all CPack generators
 
-//  cm->DefineProperty
-//      ("CPACK_PACKAGE_VENDOR", cmProperty::VARIABLE,
-//       "The name of the package vendor.",
-//       "If not specified, defaults to \"Humanity\"."
-//       "", false,
-//       "Variables common to all CPack generators");
+  cm->DefineProperty
+      ("CPACK_PACKAGING_INSTALL_PREFIX", cmProperty::VARIABLE,
+       "The prefix used in the built package.",
+       "Each CPack generator has a default value (like /usr)."
+       " This default value may"
+       " be overwritten from the CMakeLists.txt or the cpack command line"
+       " by setting an alternative value.\n"
+       "e.g. "
+       " set(CPACK_PACKAGING_INSTALL_PREFIX \"/opt\")\n"
+       "This is not the same purpose as CMAKE_INSTALL_PREFIX which"
+       " is used when installing from the build tree without building"
+       " a package."
+       "", false,
+       "Variables common to all CPack generators");
 
   // Subsection: variables defined/used by cpack,
   // which are specific to one CPack generator

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=543f1adfa4a8f2f38371512ffcb8c252332acb18
commit 543f1adfa4a8f2f38371512ffcb8c252332acb18
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Thu Feb 2 01:44:21 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:23 2012 -0500

    Make the load of script documentation more efficient and dynamic.
    
    CPack help will be searched in any CPack*.cmake file located
    near to CPack.cmake file. The script files is parsed iff
    the first line begin with ##section. Moreover the documentation
    section name is specified on the remaining part of the line
    minus the space immediately following ##section.

diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 1718008..8a44991 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -1,3 +1,6 @@
+##section Variables common to all CPack generators
+##end
+##module
 # - Build binary and source package installers.
 # The CPack module generates binary and source installers in a variety
 # of formats using the cpack program. Inclusion of the CPack module
@@ -28,16 +31,16 @@
 # on a per-generator basis. It only need contain overrides.
 #
 # Here's how it works:
-# - cpack runs
-# - it includes CPackConfig.cmake
-# - it iterates over the generators listed in that file's
-#     CPACK_GENERATOR list variable (unless told to use just a
-#     specific one via -G on the command line...)
+#  - cpack runs
+#  - it includes CPackConfig.cmake
+#  - it iterates over the generators listed in that file's
+#    CPACK_GENERATOR list variable (unless told to use just a
+#    specific one via -G on the command line...)
 #
-# - foreach generator, it then
-#   - sets CPACK_GENERATOR to the one currently being iterated
-#   - includes the CPACK_PROJECT_CONFIG_FILE
-#   - produces the package for that generator
+#  - foreach generator, it then
+#    - sets CPACK_GENERATOR to the one currently being iterated
+#    - includes the CPACK_PROJECT_CONFIG_FILE
+#    - produces the package for that generator
 #
 # This is the key: For each generator listed in CPACK_GENERATOR
 # in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR
@@ -47,6 +50,7 @@
 # Before including this CPack module in your CMakeLists.txt file,
 # there are a variety of variables that can be set to customize
 # the resulting installers. The most commonly-used variables are:
+##end
 #
 ##variable
 #   CPACK_PACKAGE_NAME - The name of the package (or application). If
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index fc7f992..0916843 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -1,3 +1,6 @@
+##section Variables specific to a CPack generator
+##end
+##module
 # - The builtin (binary) CPack Deb generator (Unix only)
 # CPackDeb may be used to create Deb package using CPack.
 # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
@@ -11,6 +14,7 @@
 # the wiki:
 #  http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
 # However as a handy reminder here comes the list of specific variables:
+##end
 #
 ##variable
 # CPACK_DEBIAN_PACKAGE_NAME
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index de06fef..f76e91e 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -1,5 +1,7 @@
-# - The builtin (binary) CPack RPM generator (Unix only)
+##section Variables specific to a CPack generator
+##end
 ##module
+# - The builtin (binary) CPack RPM generator (Unix only)
 # CPackRPM may be used to create RPM package using CPack.
 # CPackRPM is a CPack generator thus it uses the CPACK_XXX variables
 # used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 4117971..25a72fa 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -26,6 +26,8 @@
 #include "cmCPackLog.h"
 
 #include <cmsys/CommandLineArguments.hxx>
+#include <cmsys/Glob.hxx>
+#include <cmsys/SystemTools.hxx>
 #include <memory> // auto_ptr
 
 //----------------------------------------------------------------------------
@@ -527,22 +529,54 @@ int main (int argc, char *argv[])
 
     typedef std::pair<std::string,std::string> docModuleSectionPair_t;
     typedef std::list<docModuleSectionPair_t>  docedModulesList_t;
-    docedModulesList_t docedModList;
+    docedModulesList_t     docedModList;
     docModuleSectionPair_t docPair;
     std::string            docedFile;
 
-    // build the list of files to be parsed for documentation
-    // extraction
-    docPair.first  = "CPack.cmake";
-    docPair.second = "Variables common to all CPack generators";
-    docedModList.push_back(docPair);
-    docPair.first  = "CPackComponent.cmake";
-    docedModList.push_back(docPair);
-    docPair.first  = "CPackRPM.cmake";
-    docPair.second = "Variables specific to a CPack generator";
-    docedModList.push_back(docPair);
-    docPair.first  = "CPackDeb.cmake";
-    docedModList.push_back(docPair);
+    cmsys::Glob gl;
+    std::string findExpr;
+    std::vector<std::string> files;
+    std::string line;
+    docedFile = globalMF->GetModulesFile("CPack.cmake");
+    if (docedFile.length()!=0)
+      {
+      findExpr += cmSystemTools::GetFilenamePath(docedFile.c_str());
+      findExpr += "/CPack*.cmake";
+      if (gl.FindFiles(findExpr))
+        {
+        files = gl.GetFiles();
+        for (std::vector<std::string>::iterator itf=files.begin();
+             itf!=files.end();++itf)
+          {
+          std::ifstream fin((*itf).c_str());
+          if (!fin) continue;
+          if (cmSystemTools::GetLineFromStream(fin, line))
+            {
+            if (line.find("##section")!=std::string::npos)
+              {
+              docPair.first = cmSystemTools::GetFilenameName(*itf);
+              // 10 is the size of '##section' + 1
+              docPair.second = line.substr(10,std::string::npos);
+              docedModList.push_back(docPair);
+              }
+            }
+          else
+            {
+            line.clear();
+            }
+          }
+        }
+      else
+        {
+        // build the list of files to be parsed for documentation
+        // extraction
+        docPair.first  = "CPack.cmake";
+        docPair.second = "Variables common to all CPack generators";
+        docedModList.push_back(docPair);
+        docPair.first  = "CPackComponent.cmake";
+        docedModList.push_back(docPair);
+        }
+      }
 
     // parse the files for documentation.
     for (docedModulesList_t::iterator it = docedModList.begin();
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 80f74a6..ed1e5e1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -768,6 +768,7 @@ int cmDocumentation::GetStructuredDocFromFile(
 {
     typedef enum sdoce {
         SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE,
+        SDOC_SECTION,
         SDOC_UNKNOWN} sdoc_t;
     int nbDocItemFound = 0;
     int docCtxIdx      = 0;
@@ -795,9 +796,13 @@ int cmDocumentation::GetStructuredDocFromFile(
       if(line.size() && line[0] == '#')
         {
         /* handle structured doc context */
-        if (line[1]=='#')
+        if ((line.size()>=2) && line[1]=='#')
         {
-            std::string mkword = line.substr(2,std::string::npos);
+            /* markup word is following '##' stopping at first space
+             * Some markup word like 'section' may have more characters
+             * following but we don't handle those here.
+             */
+            std::string mkword = line.substr(2,line.find(' ',2)-2);
             if (mkword=="macro")
             {
                docCtxIdx++;
@@ -822,6 +827,14 @@ int cmDocumentation::GetStructuredDocFromFile(
                docContextStack[docCtxIdx]=SDOC_MODULE;
                newCtx = true;
             }
+            else if (mkword=="section")
+            {
+               docCtxIdx++;
+               docContextStack[docCtxIdx]=SDOC_SECTION;
+               /* drop the rest of the line */
+               line.clear();
+               newCtx = true;
+            }
             else if (mkword.substr(0,3)=="end")
             {
                switch (docContextStack[docCtxIdx]) {
@@ -841,6 +854,9 @@ int cmDocumentation::GetStructuredDocFromFile(
                case SDOC_MODULE:
                    /*  not implemented */
                    break;
+               case SDOC_SECTION:
+                   /*  not implemented */
+                   break;
                default:
                    /* ignore other cases */
                    break;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cdbd1a9e39e79fe2f29dff3c3a7b9cf9c9fae3cc
commit cdbd1a9e39e79fe2f29dff3c3a7b9cf9c9fae3cc
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Wed Feb 1 21:07:29 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:23 2012 -0500

    Fix another compiler warning due to a typo

diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index fae409f..83a0a09 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -156,7 +156,6 @@ public:
                                std::vector<cmDocumentationEntry>& commands,
                                cmake* cm,
                                const char *docSection);
-  ;
 private:
   void SetForm(Form f);
   void SetDocName(const char* docname);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=52c53deb1bc0109340479aa1284e2fa03b2f5401
commit 52c53deb1bc0109340479aa1284e2fa03b2f5401
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Wed Feb 1 20:47:28 2012 +0100
Commit:     David Cole <david.cole at kitware.com>
CommitDate: Tue Feb 14 16:05:23 2012 -0500

    Really avoid compiler warning about unused vars

diff --git a/Source/CPack/cmCPackDocumentMacros.cxx b/Source/CPack/cmCPackDocumentMacros.cxx
index 94d5391..ddc75a4 100644
--- a/Source/CPack/cmCPackDocumentMacros.cxx
+++ b/Source/CPack/cmCPackDocumentMacros.cxx
@@ -1,10 +1,8 @@
 #include "cmCPackDocumentMacros.h"
 
 void cmCPackDocumentMacros::GetMacrosDocumentation(
-        std::vector<cmDocumentationEntry>& v)
+        std::vector<cmDocumentationEntry>& )
 {
-   // avoid compiler warning
-   (int)v.size();
    // Commented-out example of use
    //
    //    cmDocumentationEntry e("cpack_<macro>",
diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index 27d4df2..6327152 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -1,10 +1,8 @@
 #include "cmCPackDocumentVariables.h"
 #include "cmake.h"
 
-void cmCPackDocumentVariables::DefineVariables(cmake* cm)
+void cmCPackDocumentVariables::DefineVariables(cmake* )
 {
-  // avoid compiler warning
-  (void*)cm;
   // Subsection: variables defined/used by cpack,
   // which are common to all CPack generators
 

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list