Skip to content
Snippets Groups Projects
Commit afbdb036 authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Add docs-html target to CMake

Only added if Sphinx can be found.
Refs #9521
parent 8373eb4d
No related branches found
No related tags found
No related merge requests found
###############################################################################
# Sphinx documentation
###############################################################################
find_package ( Sphinx )
if ( SPHINX_FOUND )
# Fill in the config file and autogen file with build information
# We generate a target per build type, i.e docs-html
set ( SPHINX_BUILD ${CMAKE_BINARY_DIR}/docs )
set ( BUILDER html )
configure_file ( runsphinx.py.in runsphinx_html.py @ONLY )
# targets
set ( TARGET_PREFIX docs)
# HTML target
add_custom_target ( ${TARGET_PREFIX}-html
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/MantidPlot -xq runsphinx_html.py
COMMENT "Build Sphinx html documentation"
)
endif ()
###############################################################################
# QtAssistant
###############################################################################
if ( APPLE ) if ( APPLE )
set ( ENABLE_QTASSISTANT False CACHE BOOL "Build qt-assistant documentation" ) set ( ENABLE_QTASSISTANT False CACHE BOOL "Build qt-assistant documentation" )
else () else ()
......
"""We need to run Sphinx inside MantidPlot to document the internal
module. This script calls the sphinx entry point with the necessary
arguments
"""
__requires__ = 'Sphinx'
import sys
import os
from pkg_resources import load_entry_point
mantidplot = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/MantidPlot"
builder = "@BUILDER@"
src_dir = "@CMAKE_CURRENT_SOURCE_DIR@/source"
output_dir = os.path.join("@SPHINX_BUILD@", builder)
argv = [mantidplot,'-b', builder, src_dir, output_dir]
if __name__ == '__main__':
sys.exit(
load_entry_point(__requires__, 'console_scripts', 'sphinx-build')(argv)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment