build: Add option to enable/disable html/manpages

This commit is contained in:
patrick96 2020-12-22 12:29:26 +01:00 committed by Patrick Ziegler
parent c3fbd1e3e8
commit ddfec6fc8f
4 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `BUILD_POLYBAR_MSG=ON` - Builds the `polybar-msg` executable
- `BUILD_TESTS=OFF` - Builds the test suite
- `BUILD_DOC=ON` - Builds the documentation
- `BUILD_DOC_HTML=BUILD_DOC` - Builds the html documentation (depends on `BUILD_DOC`)
- `BUILD_DOC_MAN=BUILD_DOC` - Builds the manpages (depends on `BUILD_DOC`)
- `DISABLE_ALL=OFF` - Disables all above targets by default. Individual
targets can still be enabled explicitly.
- The documentation can no longer be built by directly configuring the `doc`

View File

@ -16,6 +16,10 @@ option(BUILD_POLYBAR_MSG "Build polybar-msg" ${DEFAULT_ON})
option(BUILD_TESTS "Build testsuite" OFF)
option(BUILD_DOC "Build documentation" ${DEFAULT_ON})
include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(BUILD_DOC_HTML "Build HTML documentation" ON "BUILD_DOC" OFF)
CMAKE_DEPENDENT_OPTION(BUILD_DOC_MAN "Build manpages" ON "BUILD_DOC" OFF)
if (BUILD_POLYBAR OR BUILD_TESTS)
set(BUILD_LIBPOLY ON)
else()

View File

@ -25,6 +25,8 @@ colored_option(" polybar" BUILD_POLYBAR)
colored_option(" polybar-msg" BUILD_POLYBAR_MSG)
colored_option(" testsuite" BUILD_TESTS)
colored_option(" documentation" BUILD_DOC)
colored_option(" html" BUILD_DOC_HTML)
colored_option(" man" BUILD_DOC_MAN)
if (BUILD_LIBPOLY)
message(STATUS " Module support:")

View File

@ -15,7 +15,13 @@ set(doc_path "${CMAKE_CURRENT_SOURCE_DIR}")
configure_file(conf.py conf.py @ONLY)
# We want to run `sphinx-build` with the following builders
set(doc_builders "html" "man")
if (BUILD_DOC_HTML)
list(APPEND doc_builders "html")
endif()
if (BUILD_DOC_MAN)
list(APPEND doc_builders "man")
endif()
# Name of all documentation targets
set(doc_targets "")