diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2022-11-06 13:32:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-11-07 15:10:23 (GMT) |
commit | a89c76a77377179fc7baab5755bb38793b4bac14 (patch) | |
tree | eaa6d0026c2bfa920433bae175b96a499bf61076 /Utilities | |
parent | 137b00cda16ce3af7a75d700a3a581924275b006 (diff) | |
download | CMake-a89c76a77377179fc7baab5755bb38793b4bac14.zip CMake-a89c76a77377179fc7baab5755bb38793b4bac14.tar.gz CMake-a89c76a77377179fc7baab5755bb38793b4bac14.tar.bz2 |
Build: Add `SPHINX_LINKCHECK` build option
Run `sphinx-build` to check external links and report broken one.
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 18 | ||||
-rw-r--r-- | Utilities/Sphinx/conf.py.in | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index fc3496b..a9aa47d 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -22,6 +22,7 @@ option(SPHINX_INFO "Build Info manual with Sphinx" OFF) option(SPHINX_MAN "Build man pages with Sphinx" OFF) option(SPHINX_HTML "Build html help with Sphinx" OFF) option(SPHINX_SINGLEHTML "Build html single page help with Sphinx" OFF) +option(SPHINX_LINKCHECK "Check external links mentioned in documentation" OFF) option(SPHINX_QTHELP "Build Qt help with Sphinx" OFF) option(SPHINX_LATEXPDF "Build PDF help with Sphinx using LaTeX" OFF) option(SPHINX_TEXT "Build text help with Sphinx (not installed)" OFF) @@ -35,7 +36,15 @@ separate_arguments(sphinx_flags UNIX_COMMAND "${SPHINX_FLAGS}") mark_as_advanced(SPHINX_TEXT) mark_as_advanced(SPHINX_FLAGS) -if(NOT SPHINX_INFO AND NOT SPHINX_MAN AND NOT SPHINX_HTML AND NOT SPHINX_SINGLEHTML AND NOT SPHINX_QTHELP AND NOT SPHINX_TEXT AND NOT SPHINX_LATEXPDF) +if(NOT (SPHINX_INFO + OR SPHINX_MAN + OR SPHINX_HTML + OR SPHINX_SINGLEHTML + OR SPHINX_LINKCHECK + OR SPHINX_QTHELP + OR SPHINX_TEXT + OR SPHINX_LATEXPDF + )) return() elseif(NOT SPHINX_EXECUTABLE) message(FATAL_ERROR "SPHINX_EXECUTABLE (sphinx-build) is not found!") @@ -79,6 +88,13 @@ endif() if(SPHINX_SINGLEHTML) list(APPEND doc_formats singlehtml) endif() +if(SPHINX_LINKCHECK) + list(APPEND doc_formats linkcheck) + # + set(linkcheck_post_commands + COMMAND ${CMAKE_COMMAND} -E echo "sphinx-build linkcheck: see checking status in file://${CMAKE_CURRENT_BINARY_DIR}/linkcheck/output.txt" + ) +endif() if(SPHINX_TEXT) list(APPEND doc_formats text) endif() diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in index 2b3083b..fc3ecb5 100644 --- a/Utilities/Sphinx/conf.py.in +++ b/Utilities/Sphinx/conf.py.in @@ -87,3 +87,5 @@ html_favicon = '@conf_path@/static/cmake-favicon.ico' # https://bitbucket.org/birkenfeld/sphinx/issue/1448/make-qthelp-more-configurable # qthelp_namespace = "org.cmake" # qthelp_qch_name = "CMake.qch" + +linkcheck_ignore = [r'about:|https://gitlab.kitware.com/cmake/community/-/wikis/doc/cpack'] |