Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
if(SPHINX_FOUND)
|
|
|
|
|
|
|
|
# Sphinx cache with pickled ReST documents
|
|
|
|
set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees")
|
|
|
|
# HTML output directory
|
|
|
|
set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")
|
|
|
|
set(SPHINX_MAN_DIR "${CMAKE_CURRENT_BINARY_DIR}/man")
|
|
|
|
set(SPHINX_PDF_DIR "${CMAKE_CURRENT_BINARY_DIR}/latex")
|
|
|
|
set(SPHINX_QCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/qthelp")
|
|
|
|
set(SPHINX_HTMLHELP_DIR "${CMAKE_CURRENT_BINARY_DIR}/htmlhelp")
|
|
|
|
set(MSHTML_COMPILER wine 'C:\\Program Files\\HTML Help Workshop\\hhc.exe')
|
2012-11-29 15:25:15 +04:00
|
|
|
# assets
|
|
|
|
set(LATEX_LOGO "${CMAKE_CURRENT_SOURCE_DIR}/logo-blue.pdf")
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
|
|
|
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" conf.py @ONLY)
|
2013-02-04 21:10:51 +04:00
|
|
|
|
2013-03-11 19:18:20 +04:00
|
|
|
if(WITH_DOC)
|
|
|
|
add_custom_target(doc ALL DEPENDS doc-html doc-man COMMENT "Building documentation...")
|
|
|
|
install(DIRECTORY ${SPHINX_HTML_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
|
|
install(DIRECTORY ${SPHINX_MAN_DIR} DESTINATION ${CMAKE_INSTALL_MANDIR})
|
|
|
|
else(WITH_DOC)
|
|
|
|
add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...")
|
|
|
|
endif(WITH_DOC)
|
2013-02-04 21:10:51 +04:00
|
|
|
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
if(PDFLATEX_FOUND)
|
|
|
|
# if this still fails on Debian/Ubuntu, run
|
|
|
|
# apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
|
|
|
|
add_custom_target(doc-latex ${SPHINX_EXECUTABLE}
|
|
|
|
-q -c . -b latex
|
|
|
|
-d ${SPHINX_CACHE_DIR}
|
2012-11-29 15:25:15 +04:00
|
|
|
-D latex_logo=${LATEX_LOGO}
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${SPHINX_PDF_DIR} )
|
|
|
|
add_custom_target(doc-pdf make -C ${SPHINX_PDF_DIR} all-pdf
|
|
|
|
DEPENDS doc-latex )
|
|
|
|
add_dependencies(doc doc-pdf)
|
2013-03-11 19:18:20 +04:00
|
|
|
if (WITH_DOC)
|
|
|
|
install(DIRECTORY ${SPHINX_PDF_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
|
|
endif (WITH_DOC)
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
endif(PDFLATEX_FOUND)
|
|
|
|
if (EXISTS ${QT_QCOLLECTIONGENERATOR_EXECUTABLE})
|
|
|
|
add_custom_target( doc-qch-sphinx ${SPHINX_EXECUTABLE}
|
|
|
|
-q -c . -b qthelp
|
|
|
|
-d ${SPHINX_CACHE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${SPHINX_QCH_DIR} )
|
|
|
|
add_custom_target( doc-qch ${QT_QCOLLECTIONGENERATOR_EXECUTABLE}
|
|
|
|
${SPHINX_QCH_DIR}/*.qhcp
|
|
|
|
DEPENDS doc-qch-sphinx )
|
|
|
|
add_dependencies(doc doc-qch)
|
2013-03-11 19:18:20 +04:00
|
|
|
if (WITH_DOC)
|
|
|
|
install(DIRECTORY ${SPHINX_QCH_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
|
|
|
endif (WITH_DOC)
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
endif()
|
|
|
|
add_custom_target( doc-html ${SPHINX_EXECUTABLE}
|
|
|
|
-q -c . -b html
|
|
|
|
-d ${SPHINX_CACHE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${SPHINX_HTML_DIR} )
|
2013-02-09 13:10:23 +04:00
|
|
|
add_custom_target( doc-man ${SPHINX_EXECUTABLE}
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
-q -c . -b man
|
|
|
|
-d ${SPHINX_CACHE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${SPHINX_MAN_DIR} )
|
2013-02-04 20:36:56 +04:00
|
|
|
|
Add doc cmake targets (HTML, PDF, QtHelp, CHM, man)
make doc will build all of the above, except for CHM,
which needs manual preparation and can be built with
make doc-chm. See doc/scripts/README.rst for details.
We do our best to ensure to detect the required tools
before adding targets, so a build should always succeed.
Exception: On Debian and Ubuntu, the following packages are
required to build the PDF target (in addition to pdflatex
itself, which is autodetected):
* texlive-latex-recommended
* texlive-latex-extra
* texlive-fonts-recommended
If pdflatex is present, but those are not, the doc target
will fail.
Results can be found in $BUILDDIR/doc/$format.
2012-11-25 03:21:27 +04:00
|
|
|
## Building CHM files requires HTML Help Workshop. Since it requires wine
|
|
|
|
## with special dependencies, it's impossible to write a cmake check for it.
|
|
|
|
## This is why doc-chm is not a dependency for doc. Instead, run
|
|
|
|
## doc/scripts/htmlhelp.exe to install them and run this target
|
|
|
|
## explicitly.
|
|
|
|
add_custom_target( doc-chm-sphinx ${SPHINX_EXECUTABLE}
|
|
|
|
-q -c . -b htmlhelp
|
|
|
|
-D html_theme=basic
|
|
|
|
-d ${SPHINX_CACHE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${SPHINX_HTMLHELP_DIR} )
|
|
|
|
add_custom_target( doc-chm pushd ${SPHINX_HTMLHELP_DIR}; ${MSHTML_COMPILER} *.hhp; popd
|
|
|
|
DEPENDS doc-chm-sphinx )
|
|
|
|
endif(SPHINX_FOUND)
|