summaryrefslogtreecommitdiffstats
path: root/Utilities/Sphinx/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/Sphinx/CMakeLists.txt')
-rw-r--r--Utilities/Sphinx/CMakeLists.txt25
1 files changed, 16 insertions, 9 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 981e554..fbce1c8 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -3,12 +3,13 @@
if(NOT CMake_SOURCE_DIR)
set(CMakeHelp_STANDALONE 1)
- cmake_minimum_required(VERSION 3.1...3.20 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.13...3.22 FATAL_ERROR)
get_filename_component(tmp "${CMAKE_CURRENT_SOURCE_DIR}" PATH)
get_filename_component(CMake_SOURCE_DIR "${tmp}" PATH)
include(${CMake_SOURCE_DIR}/Modules/CTestUseLaunchers.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeVersion.cmake)
include(${CMake_SOURCE_DIR}/Source/CMakeInstallDestinations.cmake)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake @ONLY)
unset(CMAKE_DATA_DIR)
unset(CMAKE_DATA_DIR CACHE)
macro(CMake_OPTIONAL_COMPONENT)
@@ -67,7 +68,7 @@ if(SPHINX_HTML)
# we provide the path to the produced html output in the console
# for tools that support URI protocol schemes
- set(html_extra_commands
+ set(html_post_commands
COMMAND ${CMAKE_COMMAND} -E echo "sphinx-build html: HTML documentation generated in file://${CMAKE_CURRENT_BINARY_DIR}/html/index.html"
)
@@ -93,14 +94,14 @@ if(SPHINX_INFO)
# Sphinx texinfo builder supports .info, .txt, .html and .pdf output.
# SPHINX_INFO controls the .info output.
- set(texinfo_extra_commands
+ set(texinfo_post_commands
COMMAND ${MAKEINFO_EXECUTABLE} --no-split -o
${CMAKE_CURRENT_BINARY_DIR}/texinfo/cmake.info
${CMAKE_CURRENT_BINARY_DIR}/texinfo/cmake.texi
)
endif()
if(SPHINX_QTHELP)
- find_package(PythonInterp REQUIRED)
+ find_package(Python REQUIRED)
find_program(QHELPGENERATOR_EXECUTABLE
NAMES qhelpgenerator-qt5 qhelpgenerator
@@ -111,7 +112,7 @@ if(SPHINX_QTHELP)
endif()
list(APPEND doc_formats qthelp)
- set(qthelp_extra_commands
+ set(qthelp_post_commands
# Workaround for assistant prior to
# https://codereview.qt-project.org/#change,82250 in Qt 4.
COMMAND ${CMAKE_COMMAND} "-DCSS_DIR=${CMAKE_CURRENT_BINARY_DIR}/qthelp/_static"
@@ -123,7 +124,7 @@ if(SPHINX_QTHELP)
# Create proper identifiers. Workaround for
# https://bitbucket.org/birkenfeld/sphinx/issue/1491/qthelp-should-generate-identifiers-for
- COMMAND "${PYTHON_EXECUTABLE}"
+ COMMAND "${Python_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/create_identifiers.py"
"${CMAKE_CURRENT_BINARY_DIR}/qthelp/"
@@ -147,7 +148,11 @@ if(CMake_SPHINX_CMAKE_ORG)
list(APPEND doc_html_opts -A outdated=1)
endif()
- list(APPEND qthelp_extra_commands
+ list(APPEND html_pre_commands
+ COMMAND ${CMAKE_COMMAND} -Dversion=${CMake_VERSION} -P ${CMAKE_CURRENT_SOURCE_DIR}/tutorial_archive.cmake
+ )
+
+ list(APPEND qthelp_post_commands
COMMAND ${CMAKE_COMMAND} -E copy
"${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qch"
"${CMAKE_CURRENT_BINARY_DIR}/html/CMake.qch"
@@ -169,6 +174,7 @@ foreach(format ${doc_formats})
# arguments in peculiar order
add_custom_command(
OUTPUT ${doc_format_output}
+ ${${format}_pre_commands}
COMMAND ${SPHINX_EXECUTABLE}
-M ${format}
${CMake_SOURCE_DIR}/Help
@@ -178,7 +184,7 @@ foreach(format ${doc_formats})
${sphinx_flags}
${doc_${format}_opts}
> ${doc_format_log} # log stdout, pass stderr
- ${${format}_extra_commands}
+ ${${format}_post_commands}
DEPENDS ${doc_format_last}
COMMENT "sphinx-build ${format}: see Utilities/Sphinx/${doc_format_log}"
VERBATIM
@@ -187,6 +193,7 @@ foreach(format ${doc_formats})
# other formats use standard builder (-b) mode
add_custom_command(
OUTPUT ${doc_format_output}
+ ${${format}_pre_commands}
COMMAND ${SPHINX_EXECUTABLE}
-c ${CMAKE_CURRENT_BINARY_DIR}
-d ${CMAKE_CURRENT_BINARY_DIR}/${doctrees}
@@ -196,7 +203,7 @@ foreach(format ${doc_formats})
${CMake_SOURCE_DIR}/Help
${CMAKE_CURRENT_BINARY_DIR}/${format}
> ${doc_format_log} # log stdout, pass stderr
- ${${format}_extra_commands}
+ ${${format}_post_commands}
DEPENDS ${doc_format_last}
COMMENT "sphinx-build ${format}: see Utilities/Sphinx/${doc_format_log}"
VERBATIM