CBL-Mariner/SPECS/fmt/doc-build-use-sphinx-build-...

35 строки
1.3 KiB
Diff

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 108aa71e..9b2063b8 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -4,8 +4,11 @@ if (NOT DOXYGEN)
return ()
endif ()
+find_program(SPHINX_EXECUTABLE
+ NAMES sphinx-build sphinx-build-3)
add_custom_target(doc
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.py ${FMT_VERSION}
+ COMMAND ${CMAKE_COMMAND} -E env SPHINX_EXECUTABLE=${SPHINX_EXECUTABLE}
+ ${CMAKE_CURRENT_SOURCE_DIR}/build.py ${FMT_VERSION}
SOURCES api.rst syntax.rst usage.rst build.py conf.py _templates/layout.html)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
diff --git a/doc/build.py b/doc/build.py
index 8df66bda..840fdf40 100755
--- a/doc/build.py
+++ b/doc/build.py
@@ -49,7 +49,8 @@ def build_docs(version='dev', **kwargs):
raise CalledProcessError(p.returncode, cmd)
html_dir = os.path.join(work_dir, 'html')
main_versions = reversed(versions[-3:])
- check_call(['sphinx-build',
+ sphinx_build = os.environ.get('SPHINX_EXECUTABLE', 'sphinx-build')
+ check_call([sphinx_build,
'-Dbreathe_projects.format=' + os.path.abspath(doxyxml_dir),
'-Dversion=' + version, '-Drelease=' + version,
'-Aversion=' + version, '-Aversions=' + ','.join(main_versions),
--
2.26.2