From 10e03e695b07accfc0855bb9d4989b4b90444879 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 12 Oct 2018 21:09:44 +0800 Subject: [PATCH] use found python executable for launching sphinx-build there is chance that the distro install python as python3, in that case the shebang of ``` ``` in build.py won't work. Signed-off-by: Kefu Chai --- doc/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 26fdf3d1..87ad9ecf 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -4,11 +4,13 @@ if (NOT DOXYGEN) return () endif () +find_package(PythonInterp + QUIET REQUIRED) find_program(SPHINX_EXECUTABLE NAMES sphinx-build sphinx-build-3) add_custom_target(doc COMMAND ${CMAKE_COMMAND} -E env SPHINX_EXECUTABLE=${SPHINX_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/build.py ${FMT_VERSION}) + ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build.py ${FMT_VERSION} SOURCES api.rst syntax.rst build.py conf.py _templates/layout.html) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/