[llvm] r203272 - [docs] Teach CMake docs build how to generate Qt Creator help/documentation files.

Michael Gottesman mgottesman at apple.com
Fri Mar 7 11:19:29 PST 2014


Author: mgottesman
Date: Fri Mar  7 13:19:28 2014
New Revision: 203272

URL: http://llvm.org/viewvc/llvm-project?rev=203272&view=rev
Log:
[docs] Teach CMake docs build how to generate Qt Creator help/documentation files.

Patch by Konrad Kleine.

Differential Revision: http://llvm-reviews.chandlerc.com/D2967

Modified:
    llvm/trunk/docs/CMake.rst
    llvm/trunk/docs/CMakeLists.txt
    llvm/trunk/docs/doxygen.cfg.in

Modified: llvm/trunk/docs/CMake.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=203272&r1=203271&r2=203272&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.rst (original)
+++ llvm/trunk/docs/CMake.rst Fri Mar  7 13:19:28 2014
@@ -283,6 +283,50 @@ LLVM-specific variables
   are ``Address``, ``Memory`` and ``MemoryWithOrigins``. Defaults to empty
   string.
 
+**LLVM_ENABLE_DOXYGEN**:BOOL
+  Enables the generation of browsable HTML documentation using doxygen.
+  Defaults to OFF.
+
+**LLVM_ENABLE_DOXYGEN_QT_HELP**:BOOL
+  Enables the generation of a Qt Compressed Help file. Defaults to OFF.
+  This affects the make target ``doxygen-llvm``. When enabled, apart from
+  the normal HTML output generated by doxygen, this will produce a QCH file
+  named ``org.llvm.qch``. You can then load this file into Qt Creator.
+  This option is only useful in combination with ``-DLLVM_ENABLE_DOXYGEN=ON``;
+  otherwise this has no effect.
+
+**LLVM_DOXYGEN_QCH_FILENAME**:STRING
+  The filename of the Qt Compressed Help file that will be genrated when
+  ``-DLLVM_ENABLE_DOXYGEN=ON`` and 
+  ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON`` are given. Defaults to
+  ``org.llvm.qch``.
+  This option is only useful in combination with
+  ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``;
+  otherwise this has no effect.
+
+**LLVM_DOXYGEN_QHP_NAMESPACE**:STRING
+  Namespace under which the intermediate Qt Help Project file lives. See `Qt
+  Help Project <http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace>`_
+  for more information. Defaults to "org.llvm". This option is only useful in
+  combination with ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise
+  this has no effect.
+    
+**LLVM_DOXYGEN_QHP_CUST_FILTER_NAME**:STRING
+  See `Qt Help Project
+  <http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters>`_ for
+  more information. Defaults to the CMake variable ``${PACKAGE_STRING}`` which
+  is a combination of the package name and version string. This filter can then
+  be used in Qt Creator to select only documentation from LLVM when browsing
+  through all the help files that you might have loaded. This option is only
+  useful in combination with ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``;
+  otherwise this has no effect.
+
+**LLVM_DOXYGEN_QHELPGENERATOR_PATH**:STRING
+  The path to the ``qhelpgenerator`` executable. Defaults to whatever CMake's
+  ``find_program()`` can find. This option is only useful in combination with
+  ``-DLLVM_ENABLE_DOXYGEN_QT_HELP=ON``; otherwise this has no
+  effect.
+
 Executing the test suite
 ========================
 

Modified: llvm/trunk/docs/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMakeLists.txt?rev=203272&r1=203271&r2=203272&view=diff
==============================================================================
--- llvm/trunk/docs/CMakeLists.txt (original)
+++ llvm/trunk/docs/CMakeLists.txt Fri Mar  7 13:19:28 2014
@@ -22,6 +22,40 @@ if (LLVM_ENABLE_DOXYGEN)
     set(extra_search_mappings "")
   endif()
   
+  # If asked, configure doxygen for the creation of a Qt Compressed Help file.
+  option(LLVM_ENABLE_DOXYGEN_QT_HELP
+    "Generate a Qt Compressed Help file." OFF)
+  if (LLVM_ENABLE_DOXYGEN_QT_HELP)
+    set(LLVM_DOXYGEN_QCH_FILENAME "org.llvm.qch" CACHE STRING
+      "Filename of the Qt Compressed help file")
+    set(LLVM_DOXYGEN_QHP_NAMESPACE "org.llvm" CACHE STRING 
+      "Namespace under which the intermediate Qt Help Project file lives")
+    set(LLVM_DOXYGEN_QHP_CUST_FILTER_NAME "${PACKAGE_STRING}" CACHE STRING
+      "See http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters")
+    set(LLVM_DOXYGEN_QHP_CUST_FILTER_ATTRS "${PACKAGE_NAME},${PACKAGE_VERSION}" CACHE STRING
+      "See http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes")
+    find_program(LLVM_DOXYGEN_QHELPGENERATOR_PATH qhelpgenerator 
+      DOC "Path to the qhelpgenerator binary")
+    if (NOT LLVM_DOXYGEN_QHELPGENERATOR_PATH)
+      message(FATAL_ERROR "Failed to find qhelpgenerator binary")
+    endif()
+
+    set(llvm_doxygen_generate_qhp "YES")
+    set(llvm_doxygen_qch_filename "${LLVM_DOXYGEN_QCH_FILENAME}")
+    set(llvm_doxygen_qhp_namespace "${LLVM_DOXYGEN_QHP_NAMESPACE}")
+    set(llvm_doxygen_qhelpgenerator_path "${LLVM_DOXYGEN_QHELPGENERATOR_PATH}")
+    set(llvm_doxygen_qhp_cust_filter_name "${LLVM_DOXYGEN_QHP_CUST_FILTER_NAME}")
+    set(llvm_doxygen_qhp_cust_filter_attrs "${LLVM_DOXYGEN_QHP_CUST_FILTER_ATTRS}")
+
+  else()
+    set(llvm_doxygen_generate_qhp "NO")
+    set(llvm_doxygen_qch_filename "")
+    set(llvm_doxygen_qhp_namespace "")
+    set(llvm_doxygen_qhelpgenerator_path "")
+    set(llvm_doxygen_qhp_cust_filter_name "")
+    set(llvm_doxygen_qhp_cust_filter_attrs "")
+  endif()
+  
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen.cfg.in
     ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg @ONLY)
 
@@ -33,6 +67,12 @@ if (LLVM_ENABLE_DOXYGEN)
   set(enable_server_based_search)
   set(enable_external_search)
   set(extra_search_mappings)
+  set(llvm_doxygen_generate_qhp)
+  set(llvm_doxygen_qch_filename)
+  set(llvm_doxygen_qhp_namespace)
+  set(llvm_doxygen_qhelpgenerator_path)
+  set(llvm_doxygen_qhp_cust_filter_name)
+  set(llvm_doxygen_qhp_cust_filter_attrs)
 
   add_custom_target(doxygen-llvm
     COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.cfg

Modified: llvm/trunk/docs/doxygen.cfg.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/doxygen.cfg.in?rev=203272&r1=203271&r2=203272&view=diff
==============================================================================
--- llvm/trunk/docs/doxygen.cfg.in (original)
+++ llvm/trunk/docs/doxygen.cfg.in Fri Mar  7 13:19:28 2014
@@ -938,58 +938,58 @@ BINARY_TOC             = NO
 
 TOC_EXPAND             = NO
 
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 
+# that can be used as input for Qt's qhelpgenerator to generate a 
 # Qt Compressed Help (.qch) of the generated HTML documentation.
 
-GENERATE_QHP           = NO
+GENERATE_QHP           = @llvm_doxygen_generate_qhp@
 
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
 # The path specified is relative to the HTML output folder.
 
-QCH_FILE               =
+QCH_FILE               = @llvm_doxygen_qch_filename@
 
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace
 
-QHP_NAMESPACE          = org.doxygen.Project
+QHP_NAMESPACE          = @llvm_doxygen_qhp_namespace@
 
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-folders
 
 QHP_VIRTUAL_FOLDER     = doc
 
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME   =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 
+# add. For more information please see 
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   = @llvm_doxygen_qhp_cust_filter_name@
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 
+# custom filter to add. For more information please see 
+# <a href="http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-filters"> 
 # Qt Help Project / Custom Filters</a>.
 
-QHP_CUST_FILTER_ATTRS  =
+QHP_CUST_FILTER_ATTRS  = @llvm_doxygen_qhp_cust_filter_attrs@
 
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 
+# project's 
+# filter section matches. 
+# <a href="http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes"> 
 # Qt Help Project / Filter Attributes</a>.
 
-QHP_SECT_FILTER_ATTRS  =
+QHP_SECT_FILTER_ATTRS  = 
 
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
 # .qhp file.
 
-QHG_LOCATION           =
+QHG_LOCATION           = @llvm_doxygen_qhelpgenerator_path@
 
 # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
 #  will be generated, which together with the HTML files, form an Eclipse help





More information about the llvm-commits mailing list