diff --git a/Code/Mantid/docs/CMakeLists.txt b/Code/Mantid/docs/CMakeLists.txt index 4f19643c586210e008518720ae697eb1edb45027..e9dac87df73b2354c41fe1169b2dc138ad19dd06 100644 --- a/Code/Mantid/docs/CMakeLists.txt +++ b/Code/Mantid/docs/CMakeLists.txt @@ -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" ) diff --git a/Code/Mantid/docs/runsphinx.py.in b/Code/Mantid/docs/runsphinx.py.in index 8d1011908dd06a46d37a8d4de3d7b745f9c7bd7a..45724dc86fe3273e6a7c5c727fff91ff314fe28a 100644 --- a/Code/Mantid/docs/runsphinx.py.in +++ b/Code/Mantid/docs/runsphinx.py.in @@ -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