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  d7e3fd7203968a0bc7635dcd2e796057412956fc (commit)
       via  a0b7ab01151d4812992e433175ae168d818ca6cb (commit)
      from  25d13b60b5a2acca6a256a3a75aa33d727f89854 (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=d7e3fd7203968a0bc7635dcd2e796057412956fc
commit d7e3fd7203968a0bc7635dcd2e796057412956fc
Merge: 25d13b6 a0b7ab0
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Mon Mar 31 09:45:35 2014 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Mon Mar 31 09:45:35 2014 -0400

    Merge topic 'generate-qch-doc' into next
    
    a0b7ab01 Help: Add option to create and install Qt .qch file.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a0b7ab01151d4812992e433175ae168d818ca6cb
commit a0b7ab01151d4812992e433175ae168d818ca6cb
Author:     Stephen Kelly <steve...@gmail.com>
AuthorDate: Mon Mar 31 15:44:27 2014 +0200
Commit:     Stephen Kelly <steve...@gmail.com>
CommitDate: Mon Mar 31 15:44:27 2014 +0200

    Help: Add option to create and install Qt .qch file.

diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 23dc6ae..51c83ba 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -24,6 +24,7 @@ project(CMakeHelp NONE)
 
 option(SPHINX_MAN "Build man pages with Sphinx" OFF)
 option(SPHINX_HTML "Build html help with Sphinx" OFF)
+option(SPHINX_QTHELP "Build Qt help with Sphinx" OFF)
 option(SPHINX_TEXT "Build text help with Sphinx (not installed)" OFF)
 find_program(SPHINX_EXECUTABLE
   NAMES sphinx-build
@@ -32,7 +33,7 @@ find_program(SPHINX_EXECUTABLE
 
 mark_as_advanced(SPHINX_TEXT)
 
-if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_TEXT)
+if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_QTHELP AND NOT 
SPHINX_TEXT)
   return()
 elseif(NOT SPHINX_EXECUTABLE)
   message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!")
@@ -63,6 +64,21 @@ endif()
 if(SPHINX_TEXT)
   list(APPEND doc_formats text)
 endif()
+if(SPHINX_QTHELP)
+  find_program(QCOLLECTIONGENERATOR_EXECUTABLE
+    NAMES qcollectiongenerator
+    DOC "qcollectiongenerator tool"
+    )
+  if (NOT QCOLLECTIONGENERATOR_EXECUTABLE)
+    message(FATAL_ERROR "QCOLLECTIONGENERATOR_EXECUTABLE 
(qcollectiongenerator) not found!")
+  endif()
+  list(APPEND doc_formats qthelp)
+
+  set(qthelp_extra_commands
+    COMMAND qcollectiongenerator ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qhcp
+  )
+endif()
+
 
 set(doc_format_outputs "")
 set(doc_format_last "")
@@ -78,6 +94,7 @@ foreach(format ${doc_formats})
             ${CMake_SOURCE_DIR}/Help
             ${CMAKE_CURRENT_BINARY_DIR}/${format}
             > ${doc_format_log} # log stdout, pass stderr
+    ${${format}_extra_commands}
     DEPENDS ${doc_format_last}
     COMMENT "sphinx-build ${format}: see Utilities/Sphinx/${doc_format_log}"
     VERBATIM
@@ -122,3 +139,8 @@ if(SPHINX_HTML)
           PATTERN objects.inv EXCLUDE
           )
 endif()
+if(SPHINX_QTHELP)
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qch
+          DESTINATION ${CMAKE_DOC_DIR}
+          )
+endif()
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 336c74a..c102990 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -21,6 +21,21 @@ from pygments.lexer import bygroups
 CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
                                   bygroups(Operator, Name.Variable, Operator)))
 
+# Monkey patch for sphinx generating invalid content for qcollectiongenerator
+# 
https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords
+from sphinx.util.pycompat import htmlescape
+from sphinx.builders.qthelp import QtHelpBuilder
+old_build_keywords = QtHelpBuilder.build_keywords
+def new_build_keywords(self, title, refs, subitems):
+  old_items = old_build_keywords(self, title, refs, subitems)
+  new_items = []
+  for item in old_items:
+    before, rest = item.split("ref=\"", 1)
+    ref, after = rest.split("\"")
+    new_items.append(before + "ref=\"" + htmlescape(ref) + "\"" + after)
+  return new_items
+QtHelpBuilder.build_keywords = new_build_keywords
+
 
 from docutils.parsers.rst import Directive, directives
 from docutils.transforms import Transform

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

Summary of changes:
 Utilities/Sphinx/CMakeLists.txt |   24 +++++++++++++++++++++++-
 Utilities/Sphinx/cmake.py       |   15 +++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to