Skip to content

Commit

Permalink
use found python executable for launching sphinx-build
Browse files Browse the repository at this point in the history
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 <tchaikov@gmail.com>
  • Loading branch information
tchaikov authored and vitaut committed Oct 13, 2018
1 parent 07200f4 commit 10e03e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit 10e03e6

Please sign in to comment.