From 0b713047aa9350e699d51ecf439f3109ab48a4b1 Mon Sep 17 00:00:00 2001 From: patrick96 Date: Thu, 3 Oct 2019 22:42:31 +0200 Subject: [PATCH] doc: Allow custom SPHINX_BUILD --- cmake/02-opts.cmake | 3 ++- doc/CMakeLists.txt | 10 +--------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/cmake/02-opts.cmake b/cmake/02-opts.cmake index 16506a7c..6aa7b7bf 100644 --- a/cmake/02-opts.cmake +++ b/cmake/02-opts.cmake @@ -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) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index ed67799b..01d44852 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -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}"