diff options
author | Brad King <brad.king@kitware.com> | 2018-06-13 14:50:08 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-06-13 14:50:14 (GMT) |
commit | aa155de8607d6faeace64dfb47a469d9329a4fcd (patch) | |
tree | f6d8b6f1f23d01d7ccc966d32db283da6224a48c /Utilities | |
parent | 0247f6836c9318396c91ec01dc682b12185a37e4 (diff) | |
parent | 276e369813f100562c3e22020635552edfb722a2 (diff) | |
download | CMake-aa155de8607d6faeace64dfb47a469d9329a4fcd.zip CMake-aa155de8607d6faeace64dfb47a469d9329a4fcd.tar.gz CMake-aa155de8607d6faeace64dfb47a469d9329a4fcd.tar.bz2 |
Merge topic 'sphinx-info'
276e369813 Utilities/Sphinx: Add option to build and install Info manual
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2146
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 2de821c..1cbc463 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -17,6 +17,7 @@ if(NOT CMake_SOURCE_DIR) endif() project(CMakeHelp NONE) +option(SPHINX_INFO "Build Info manual with Sphinx" OFF) option(SPHINX_MAN "Build man pages with Sphinx" OFF) option(SPHINX_HTML "Build html help with Sphinx" OFF) option(SPHINX_SINGLEHTML "Build html single page help with Sphinx" OFF) @@ -32,7 +33,7 @@ separate_arguments(sphinx_flags UNIX_COMMAND "${SPHINX_FLAGS}") mark_as_advanced(SPHINX_TEXT) mark_as_advanced(SPHINX_FLAGS) -if(NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_SINGLEHTML AND NOT SPHINX_QTHELP AND NOT SPHINX_TEXT) +if(NOT SPHINX_INFO AND NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_SINGLEHTML AND NOT SPHINX_QTHELP AND NOT SPHINX_TEXT) return() elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") @@ -66,6 +67,24 @@ endif() if(SPHINX_TEXT) list(APPEND doc_formats text) endif() +if(SPHINX_INFO) + find_program(MAKEINFO_EXECUTABLE + NAMES makeinfo + DOC "makeinfo tool" + ) + if (NOT MAKEINFO_EXECUTABLE) + message(FATAL_ERROR "MAKEINFO_EXECUTABLE (makeinfo) not found!") + endif() + list(APPEND doc_formats texinfo) + + # Sphinx texinfo builder supports .info, .txt, .html and .pdf output. + # SPHINX_INFO controls the .info output. + set(texinfo_extra_commands + COMMAND ${MAKEINFO_EXECUTABLE} --no-split -o + ${CMAKE_CURRENT_BINARY_DIR}/texinfo/cmake.info + ${CMAKE_CURRENT_BINARY_DIR}/texinfo/cmake.texi + ) +endif() if(SPHINX_QTHELP) find_package(PythonInterp REQUIRED) @@ -143,6 +162,14 @@ if(CMake_SPHINX_DEPEND_ON_EXECUTABLES) endforeach() endif() +if(SPHINX_INFO) + CMake_OPTIONAL_COMPONENT(sphinx-info) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/texinfo/cmake.info + DESTINATION ${CMAKE_INFO_DIR} + ${COMPONENT} + ) +endif() + if(SPHINX_MAN) file(GLOB man_rst RELATIVE ${CMake_SOURCE_DIR}/Help/manual ${CMake_SOURCE_DIR}/Help/manual/*.[1-9].rst) |