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

Use cmake variable to set MantidPlot used for docs build

This will allow us to use a package rather than a fresh build if
necessary.
Refs #9521
parent c5db8582
No related branches found
No related tags found
No related merge requests found
......@@ -4,20 +4,21 @@
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 ( SCREENSHOTS_DIR ${SPHINX_BUILD}/screenshots )
# We generate a target per build type, i.e docs-html, docs-test
set ( SPHINX_BUILD_DIR ${CMAKE_BINARY_DIR}/docs )
set ( SCREENSHOTS_DIR ${SPHINX_BUILD_DIR}/screenshots )
# targets
set ( TARGET_PREFIX docs)
# runner - default=current build
set ( DOCS_RUNNER_EXE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/MantidPlot CACHE FILEPATH
"MantidPlot executable to use to build the documentation" )
# HTML target
set ( BUILDER html )
configure_file ( runsphinx.py.in runsphinx_html.py @ONLY )
add_custom_target ( ${TARGET_PREFIX}-html
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/MantidPlot -xq runsphinx_html.py
COMMAND ${DOCS_RUNNER_EXE} -xq runsphinx_html.py
COMMENT "Building html documentation"
)
......@@ -25,7 +26,7 @@ if ( SPHINX_FOUND )
set ( BUILDER doctest )
configure_file ( runsphinx.py.in runsphinx_doctest.py @ONLY )
add_custom_target ( ${TARGET_PREFIX}-test
COMMAND ${PYTHON_EXECUTABLE} runsphinx_doctest.py
COMMAND ${DOCS_RUNNER_EXE} -xq runsphinx_doctest.py
COMMENT "Running documentation tests"
)
......
......@@ -12,7 +12,7 @@ mantidplot = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@/MantidPlot"
builder = "@BUILDER@"
src_dir = "@CMAKE_CURRENT_SOURCE_DIR@/source"
screenshots_dir = "@SCREENSHOTS_DIR@"
output_dir = os.path.join("@SPHINX_BUILD@", builder)
output_dir = os.path.join("@SPHINX_BUILD_DIR@", builder)
# set environment
os.environ["SCREENSHOTS_DIR"] = screenshots_dir
......
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