doc: Allow custom SPHINX_BUILD

This commit is contained in:
patrick96 2019-10-03 22:42:31 +02:00 committed by Patrick Ziegler
parent 0276d11fd9
commit 0b713047aa
2 changed files with 3 additions and 10 deletions

View File

@ -1,7 +1,8 @@
#
# Build options
#
checklib(BUILD_DOC "binary" sphinx-build)
set(SPHINX_BUILD "sphinx-build" CACHE STRING "Name/Path of the sphinx-build executable to use.")
checklib(BUILD_DOC "binary" "${SPHINX_BUILD}")
checklib(ENABLE_ALSA "pkg-config" alsa)
checklib(ENABLE_CURL "pkg-config" libcurl)

View File

@ -3,14 +3,6 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# Only used if documentation is built on its own
project(polybar-doc NONE)
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build
DOC "Sphinx Documentation Builder")
if(NOT SPHINX_EXECUTABLE)
message_colored(FATAL_ERROR "Failed to locate sphinx-build" 31)
endif()
set(SPHINX_FLAGS "" CACHE STRING "Flags to pass to sphinx-build")
separate_arguments(sphinx_flags UNIX_COMMAND "${SPHINX_FLAGS}")
@ -29,7 +21,7 @@ foreach(builder ${doc_builders})
set(doc_target "doc_${builder}")
set(builder_log "builder-${builder}.log")
add_custom_target(${doc_target}
COMMAND ${SPHINX_EXECUTABLE}
COMMAND ${SPHINX_BUILD}
-b ${builder}
# conf.py dir
-c "${CMAKE_CURRENT_BINARY_DIR}"