[Cmake-commits] CMake branch, next, updated. v2.8.7-2712-g48382d5

Eric Noulard eric.noulard at gmail.com
Sat Feb 18 16:12:30 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  48382d577d3bda377183c781096b595dc3f260ad (commit)
       via  b8a274c091b63e6203b61f5aee40393d1409c9fc (commit)
       via  a6bce55aefd332f148a2753d5be0ec4383534473 (commit)
      from  7339cab0d39c5bcdceca220d4397b796a6fbab56 (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=48382d577d3bda377183c781096b595dc3f260ad
commit 48382d577d3bda377183c781096b595dc3f260ad
Merge: 7339cab b8a274c
Author:     Eric Noulard <eric.noulard at gmail.com>
AuthorDate: Sat Feb 18 16:12:29 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Feb 18 16:12:29 2012 -0500

    Merge topic 'CPack-dynamicDocSection' into next
    
    b8a274c Add structured documentation for NSIS
    a6bce55 Dynamically add documentation section specified in documented script.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8a274c091b63e6203b61f5aee40393d1409c9fc
commit b8a274c091b63e6203b61f5aee40393d1409c9fc
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sat Feb 18 22:10:19 2012 +0100
Commit:     Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Sat Feb 18 22:10:19 2012 +0100

    Add structured documentation for NSIS

diff --git a/Modules/CPackNSIS.cmake b/Modules/CPackNSIS.cmake
index d9dab53..093d0fc 100644
--- a/Modules/CPackNSIS.cmake
+++ b/Modules/CPackNSIS.cmake
@@ -1,70 +1,112 @@
+##section Variables specific to CPack Debian (DEB) generator
+##end
+##module
 # - CPack NSIS generator specific options
 #
 # The following variables are specific to the graphical installers built
 # on Windows using the Nullsoft Installation System.
+##end
 #
+##variable
 #   CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
 #   installing this project.
+##end
 #
+##variable
 #   CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
 #   to the end user by the NSIS installer is under this root dir. The full
 #   directory presented to the end user is:
 #   ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
+##end
 #
+##variable
 #   CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
 #   install program.
+##end
 #
+##variable
 #   CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
 #   uninstall program.
+##end
 #
+##variable
 #   CPACK_PACKAGE_ICON - A branding image that will be displayed inside
 #   the installer.
+##end
 #
+##variable
 #   CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
 #   be added to the install Section.
+##end
 #
+##variable
 #   CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
 #   be added to the uninstall Section.
+##end
 #
+##variable
 #   CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
 #   NSIS SetCompressor command.
+##end
 #
+##variable
 #   CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
 #   will appear in the installer that will allow the user to choose
 #   whether the program directory should be added to the system PATH
 #   variable.
+##end
 #
+##variable
 #   CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
 #   the Windows Add/Remove Program control panel
+##end
 #
+##variable
 #   CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
 #   installer.
+##end
 #
+##variable
 #   CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
 #   contains the installer icon.
+##end
 #
+##variable
 #   CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
 #   installing your application.
+##end
 #
+##variable
 #   CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
 #   information about your application.
+##end
 #
+##variable
 #   CPACK_NSIS_CONTACT - Contact information for questions and comments
 #   about the installation process.
+##end
 #
+##variable
 #   CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
 #   creating start menu shortcuts.
+##end
 #
+##variable
 #   CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
 #   uninstall start menu shortcuts.
+##end
 #
+##variable
 #   CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
 #   assumes that they are in 'bin' unless this variable is set.
 #   For example, you would set this to 'exec' if your executables are
 #   in an exec directory.
+##end
 #
+##variable
 #   CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
 #   to run on the finish page of the NSIS installer.
+##end
 
 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6bce55aefd332f148a2753d5be0ec4383534473
commit a6bce55aefd332f148a2753d5be0ec4383534473
Author:     Eric NOULARD <eric.noulard at gmail.com>
AuthorDate: Sat Feb 18 22:07:39 2012 +0100
Commit:     Eric NOULARD <eric.noulard at gmail.com>
CommitDate: Sat Feb 18 22:07:39 2012 +0100

    Dynamically add documentation section specified in documented script.
    
    Modify CPackDeb and CPackRPM as an example

diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 0916843..fe81dc9 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -1,4 +1,4 @@
-##section Variables specific to a CPack generator
+##section Variables specific to CPack Debian (DEB) generator
 ##end
 ##module
 # - The builtin (binary) CPack Deb generator (Unix only)
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index f76e91e..ae81ab7 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -1,4 +1,4 @@
-##section Variables specific to a CPack generator
+##section Variables specific to CPack RPM generator
 ##end
 ##module
 # - The builtin (binary) CPack RPM generator (Unix only)
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index c541610..6f5055c 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -514,7 +514,6 @@ int main (int argc, char *argv[])
   if ( help )
     {
     // Construct and print requested documentation.
-    std::vector<cmDocumentationEntry> variables;
 
     doc.SetName("cpack");
     doc.SetSection("Name",cmDocumentationName);
@@ -545,7 +544,7 @@ int main (int argc, char *argv[])
       {
           doc.GetStructuredDocFromFile(
               (docedIt->first).c_str(),
-              commands,&cminst,(docedIt->second).c_str());
+              commands,&cminst);
       }
 
     std::map<std::string,cmDocumentationSection *> propDocs;
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 02f69f1..17e35d8 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -745,6 +745,18 @@ void cmDocumentation::addCPackStandardDocSections()
             "Variables specific to a CPack generator");
 }
 
+void cmDocumentation::addAutomaticVariableSections(const std::string& section)
+{
+  std::vector<std::string>::iterator it;
+  it = find(this->VariableSections.begin(),
+            this->VariableSections.end(),
+            section);
+  /* if the section does not exist then add it */
+  if (it==this->VariableSections.end())
+    {
+    this->VariableSections.push_back(section);
+    }
+}
 //----------------------------------------------------------------------------
 int cmDocumentation::getDocumentedModulesListInDir(
           std::string path,
@@ -818,8 +830,7 @@ static void trim(std::string& s)
 int cmDocumentation::GetStructuredDocFromFile(
         const char* fname,
         std::vector<cmDocumentationEntry>& commands,
-        cmake* cm,
-        const char *docSection)
+        cmake* cm)
 {
     typedef enum sdoce {
         SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE,
@@ -835,6 +846,7 @@ int cmDocumentation::GetStructuredDocFromFile(
       {
       return nbDocItemFound;
       }
+    std::string section;
     std::string name;
     std::string full;
     std::string brief;
@@ -886,6 +898,8 @@ int cmDocumentation::GetStructuredDocFromFile(
             {
                docCtxIdx++;
                docContextStack[docCtxIdx]=SDOC_SECTION;
+               // 10 is the size of '##section' + 1
+               section = line.substr(10,std::string::npos);
                /* drop the rest of the line */
                line = "";
                newCtx = true;
@@ -900,11 +914,12 @@ int cmDocumentation::GetStructuredDocFromFile(
                            brief.c_str(),full.c_str()));
                    break;
                case SDOC_VARIABLE:
+                   this->addAutomaticVariableSections(section);
                    cm->DefineProperty
                        (name.c_str(), cmProperty::VARIABLE,
                         brief.c_str(),
                         full.c_str(),false,
-                        docSection);
+                        section.c_str());
                    break;
                case SDOC_MODULE:
                    /*  not implemented */
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index 00dba1a..11bef16 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -147,6 +147,9 @@ public:
   /** Add the CPack standard documentation section(s) */
   void addCPackStandardDocSections();
 
+  /** Add automatic variables sections */
+  void addAutomaticVariableSections(const std::string& section);
+
   /**
    * Retrieve the list of documented module located in
    * path which match the globing expression globExpr.
@@ -185,8 +188,7 @@ public:
    */
   int GetStructuredDocFromFile(const char* fname,
                                std::vector<cmDocumentationEntry>& commands,
-                               cmake* cm,
-                               const char *docSection);
+                               cmake* cm);
 private:
   void SetForm(Form f);
   void SetDocName(const char* docname);

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

Summary of changes:
 Modules/CPackDeb.cmake     |    2 +-
 Modules/CPackNSIS.cmake    |   42 ++++++++++++++++++++++++++++++++++++++++++
 Modules/CPackRPM.cmake     |    2 +-
 Source/CPack/cpack.cxx     |    3 +--
 Source/cmDocumentation.cxx |   21 ++++++++++++++++++---
 Source/cmDocumentation.h   |    6 ++++--
 6 files changed, 67 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list