[llvm] r282240 - cmake: Support overriding Sphinx HTML doc install directory

Michal Gorny via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 04:09:34 PDT 2016


Author: mgorny
Date: Fri Sep 23 06:09:33 2016
New Revision: 282240

URL: http://llvm.org/viewvc/llvm-project?rev=282240&view=rev
Log:
cmake: Support overriding Sphinx HTML doc install directory

Provide ${PROJECT}_INSTALL_SPHINX_HTML_DIR variables (e.g.
LLVM_INSTALL_SPHINX_HTML_DIR) to override Sphinx HTML doc install
directory.

Bug: https://llvm.org/bugs/show_bug.cgi?id=23780

Differential Revision: https://reviews.llvm.org/D23757

Modified:
    llvm/trunk/cmake/modules/AddSphinxTarget.cmake
    llvm/trunk/docs/CMake.rst

Modified: llvm/trunk/cmake/modules/AddSphinxTarget.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddSphinxTarget.cmake?rev=282240&r1=282239&r2=282240&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddSphinxTarget.cmake (original)
+++ llvm/trunk/cmake/modules/AddSphinxTarget.cmake Fri Sep 23 06:09:33 2016
@@ -53,8 +53,15 @@ function (add_sphinx_target builder proj
                 DESTINATION share/man/man1)
 
       elseif (builder STREQUAL html)
-        install(DIRECTORY "${SPHINX_BUILD_DIR}"
-                DESTINATION "share/doc/${project}")
+        string(TOUPPER "${project}" project_upper)
+        set(${project_upper}_INSTALL_SPHINX_HTML_DIR "share/doc/${project}/html"
+            CACHE STRING "HTML documentation install directory for ${project}")
+
+        # '/.' indicates: copy the contents of the directory directly into
+        # the specified destination, without recreating the last component
+        # of ${SPHINX_BUILD_DIR} implicitly.
+        install(DIRECTORY "${SPHINX_BUILD_DIR}/."
+                DESTINATION "${${project_upper}_INSTALL_SPHINX_HTML_DIR}")
       else()
         message(WARNING Installation of ${builder} not supported)
       endif()

Modified: llvm/trunk/docs/CMake.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/CMake.rst?rev=282240&r1=282239&r2=282240&view=diff
==============================================================================
--- llvm/trunk/docs/CMake.rst (original)
+++ llvm/trunk/docs/CMake.rst Fri Sep 23 06:09:33 2016
@@ -456,6 +456,11 @@ LLVM-specific variables
   If enabled then sphinx documentation warnings will be treated as
   errors. Defaults to ON.
 
+**LLVM_INSTALL_SPHINX_HTML_DIR**:STRING
+  The path to install Sphinx-generated HTML documentation to. This path can
+  either be absolute or relative to the CMAKE_INSTALL_PREFIX. Defaults to
+  `share/doc/llvm/html`.
+
 **LLVM_CREATE_XCODE_TOOLCHAIN**:BOOL
   OS X Only: If enabled CMake will generate a target named
   'install-xcode-toolchain'. This target will create a directory at




More information about the llvm-commits mailing list