summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-09-17 16:08:05 -0400
committerBrad King <brad.king@kitware.com>2013-10-16 09:22:37 -0400
commitbfe07aa97efdd0c9a5fb9eb7adc0a1a166149711 (patch)
treefe8d3fce64d6708f032411f497e7b3c3e99857ac /bootstrap
parent53ded5951537cd776ed5d1db7b2002bb580583be (diff)
downloadcmake-bfe07aa97efdd0c9a5fb9eb7adc0a1a166149711.tar.gz
Build Help documentation during CMake build using Sphinx
Add a Utilities/Sphinx directory to hold CMake build code to run the Sphinx (sphinx-doc.org) documentation generation tool. Create a CMakeLists.txt file there capable of building either as a subdirectory of the main CMake build, or as a standalone documentation build. Add cache options SPHINX_MAN and SPHINX_HTML to select output formats and SPHINX_EXECUTABLE to specify the sphinx-build executable. Add bootstrap options --sphix-man and --sphinx-html to select output formats and --sphinx-build=<sb> to specify the sphinx-build executable. Create a "conf.py.in" file to configure_file into "conf.py" to tell sphinx-build how to build our documents. Create a "cmake.py" Sphinx extension module defining: * The "cmake-module" directive used in Help/module/*.rst files to scan .rst markup from the corresponding Modules/*.cmake file. * A Sphinx domain called "cmake" defining documentation object types for CMake Help/<type> directories: command, generator, manual, module, policy, prop_*, and variable. Add a "role" for each type to perform cross-references. Teach the roles to treat "<XYZ>" as placeholders instead of explicit targets if not preceded by a space. Add cmake domain directives to define command and variable objects explicitly in .rst file content. This will allow modules to define their own commands and variables and have them indexed and linkable. * A Sphinx document transform that converts Help/<type>/*.rst documents into cmake domain objects of the corresponding <type> and adds index entries for them. This will automatically index all CMake documentation objects and provide cross-reference targets for them with no special markup in the .rst files.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap25
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstrap b/bootstrap
index edd12d4d49..f2cfcaa53a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -66,6 +66,9 @@ cmake_init_file=""
cmake_bootstrap_system_libs=""
cmake_bootstrap_qt_gui=""
cmake_bootstrap_qt_qmake=""
+cmake_sphinx_man=""
+cmake_sphinx_html=""
+cmake_sphinx_build=""
# Determine whether this is a Cygwin environment.
if echo "${cmake_system}" | grep CYGWIN >/dev/null 2>&1; then
@@ -375,6 +378,10 @@ Configuration:
--no-qt-gui do not build the Qt-based GUI (default)
--qt-qmake=<qmake> use <qmake> as the qmake executable to find Qt
+ --sphinx-man build man pages with Sphinx
+ --sphinx-html build html help with Sphinx
+ --sphinx-build=<sb> use <sb> as the sphinx-build executable
+
Directory and file names:
--prefix=PREFIX install files in tree rooted at PREFIX
['"${cmake_default_prefix}"']
@@ -606,6 +613,9 @@ while test $# != 0; do
--qt-gui) cmake_bootstrap_qt_gui="1" ;;
--no-qt-gui) cmake_bootstrap_qt_gui="0" ;;
--qt-qmake=*) cmake_bootstrap_qt_qmake=`cmake_arg "$1"` ;;
+ --sphinx-man) cmake_sphinx_man="1" ;;
+ --sphinx-html) cmake_sphinx_html="1" ;;
+ --sphinx-build=*) cmake_sphinx_build=`cmake_arg "$1"` ;;
--help) cmake_usage ;;
--version) cmake_version_display ; exit 2 ;;
--verbose) cmake_verbose=TRUE ;;
@@ -1563,6 +1573,21 @@ if [ "x${cmake_bootstrap_qt_qmake}" != "x" ]; then
set (QT_QMAKE_EXECUTABLE "'"${cmake_bootstrap_qt_qmake}"'" CACHE FILEPATH "Location of Qt qmake" FORCE)
' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
fi
+if [ "x${cmake_sphinx_man}" != "x" ]; then
+ echo '
+set (SPHINX_MAN "'"${cmake_sphinx_man}"'" CACHE FILEPATH "Build man pages with Sphinx" FORCE)
+' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
+fi
+if [ "x${cmake_sphinx_html}" != "x" ]; then
+ echo '
+set (SPHINX_HTML "'"${cmake_sphinx_html}"'" CACHE FILEPATH "Build html help with Sphinx" FORCE)
+' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
+fi
+if [ "x${cmake_sphinx_build}" != "x" ]; then
+ echo '
+set (SPHINX_EXECUTABLE "'"${cmake_sphinx_build}"'" CACHE FILEPATH "Location of Qt sphinx-build" FORCE)
+' >> "${cmake_bootstrap_dir}/InitialCacheFlags.cmake"
+fi
# Add user-specified settings. Handle relative-path case for
# specification of cmake_init_file.