moved conf.py to its right place

cleaned up the cmake for building the docs nicer
This commit is contained in:
naxuroqa 2013-08-16 16:15:15 +02:00
parent 03d69140e9
commit cc21c62b71
2 changed files with 38 additions and 40 deletions

View File

@ -1,40 +1,38 @@
# cmake should not fail if sphinx is missing
find_package(Sphinx)
find_package(Sphinx QUIET)
if(SPHINX_EXECUTABLE)
if(NOT DEFINED SPHINX_THEME)
if(NOT DEFINED SPHINX_THEME)
set(SPHINX_THEME default)
endif()
endif()
if(NOT DEFINED SPHINX_THEME_DIR)
if(NOT DEFINED SPHINX_THEME_DIR)
set(SPHINX_THEME_DIR)
endif()
endif()
# configured documentation tools and intermediate build results
set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
# configured documentation tools and intermediate build results
set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
# Sphinx cache with pickled ReST documents
set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
# Sphinx cache with pickled ReST documents
set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
# HTML output directory
set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
# HTML output directory
set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py"
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in"
"${BINARY_BUILD_DIR}/conf.py"
@ONLY)
if(SPHINX_FOUND)
add_custom_target(docs
${SPHINX_EXECUTABLE}
-b html
-c "${BINARY_BUILD_DIR}"
-d "${SPHINX_CACHE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${SPHINX_HTML_DIR}"
COMMENT "Building HTML documentation with Sphinx")
else()
add_custom_target(docs
echo
"Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest"
COMMENT "No sphinx executebale found")
echo "Please install python-sphinx to build the docs or read the docs online: https://projecttox.readthedocs.org/en/latest"
- COMMENT "No sphinx executable found")
endif()

View File

@ -91,7 +91,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_theme = '@SPHINX_THEME@'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@ -99,7 +99,7 @@ html_theme = 'default'
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
html_theme_path = ['@SPHINX_THEME_DIR@']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".