intermediate commit

This commit is contained in:
mpilman 2019-02-06 17:54:01 -08:00 committed by Alex Miller
parent 70545e07d8
commit 543e6b9000
3 changed files with 24 additions and 0 deletions

View File

@ -222,6 +222,7 @@ endif()
add_subdirectory(bindings)
add_subdirectory(fdbbackup)
add_subdirectory(tests)
add_subdirectory(documentation)
if(WIN32)
add_subdirectory(packaging/msi)

7
cmake/FindSphinx.cmake Normal file
View File

@ -0,0 +1,7 @@
find_program(SPHINXBUILD
sphinx-build
DOC "Sphinx-build tool")
find_package_handle_standard_args(Sphinx
FOUND_VAR SPHINX_FOUND
REQUIRED_VARS SPHINXBUILD)

View File

@ -0,0 +1,16 @@
find_package(Sphinx)
if(SPHINX_FOUND)
set(SPHINX_OPTIONS "" CACHE STRING "Additional Options to pass to sphinx-build")
set(SPHINX_PAPER_SIZE "letter" CACHE STRING "Paper size for documents generated with sphinx")
set(SPHINX_OPTS "${SPHINX_OPTIONS} -c . -d ${CMAKE_CURRENT_BINARY_DIR}/doctrees -D latex_paper_size=${SPHINX_PAPER_SIZE}")
file(GLOB_RECURSE RST_FILES "source/*rst")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html ${CMAKE_CURRENT_BINARY_DIR}/doctrees)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html
COMMAND ${SPHINXBUILD} -b html ${SPHINX_OPTS} ${CMAKE_CURRENT_BINARY_DIR}/html
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/sphinx
DEPENDS ${RST_FILES})
add_custom_target(html DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
else()
message(WARNING "Cound not find sphinx-build - will not build documentatioin")
endif()