From: Michal Gorny Date: Fri, 23 Sep 2016 11:09:33 +0000 (+0000) Subject: cmake: Support overriding Sphinx HTML doc install directory X-Git-Tag: android-x86-7.1-r4~26790 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=91fdd2b6639ae79e0e22406ca6640e544a57d7eb;p=android-x86%2Fexternal-llvm.git 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282240 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/cmake/modules/AddSphinxTarget.cmake b/cmake/modules/AddSphinxTarget.cmake index 045dc23ca2a..a968555aa06 100644 --- a/cmake/modules/AddSphinxTarget.cmake +++ b/cmake/modules/AddSphinxTarget.cmake @@ -53,8 +53,15 @@ function (add_sphinx_target builder project) 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() diff --git a/docs/CMake.rst b/docs/CMake.rst index 5d57bc98596..9e7967cf395 100644 --- a/docs/CMake.rst +++ b/docs/CMake.rst @@ -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