-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Daniel Molkentin
committed
Nov 24, 2012
1 parent
f7b7669
commit 78c7dc9
Showing
9 changed files
with
472 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
find_program(PDFLATEX_EXECUTABLE NAMES pdflatex | ||
HINTS | ||
$ENV{PDFLATEX_DIR} | ||
PATH_SUFFIXES bin | ||
DOC "PDF LaTeX" | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args(PdfLatex DEFAULT_MSG | ||
PDFLATEX_EXECUTABLE | ||
) | ||
|
||
mark_as_advanced( | ||
PDFLATEX_EXECUTABLE | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
find_program(SPHINX_EXECUTABLE NAMES sphinx-build | ||
HINTS | ||
$ENV{SPHINX_DIR} | ||
PATH_SUFFIXES bin | ||
DOC "Sphinx documentation generator" | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args(Sphinx DEFAULT_MSG | ||
SPHINX_EXECUTABLE | ||
) | ||
|
||
mark_as_advanced( | ||
SPHINX_EXECUTABLE | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
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') | ||
|
||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" conf.py @ONLY) | ||
add_custom_target(doc ALL DEPENDS doc-html doc-man COMMENT "Building documentation...") | ||
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} | ||
${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) | ||
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) | ||
endif() | ||
add_custom_target( doc-html ${SPHINX_EXECUTABLE} | ||
-q -c . -b html | ||
-d ${SPHINX_CACHE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${SPHINX_HTML_DIR} ) | ||
add_custom_target( doc-man ${SPHINX_EXECUTABLE} | ||
-q -c . -b man | ||
-d ${SPHINX_CACHE_DIR} | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
${SPHINX_MAN_DIR} ) | ||
## 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Doc Build Convenience Scripts | ||
============================= | ||
|
||
* ``htmlhelp.sh``: A script to install Microsoft HTML Workshop on Linux or Mac OS using Wine, along with some dependencies. | ||
* ``htmlhelp.reg``: Registry file to override some DLLs with their native version and set the right Windows version. | ||
|
||
Those files have been taken from the HTML Help Project (http://code.google.com/p/htmlhelp/wiki/HHW4Wine). | ||
|
||
License | ||
------- | ||
|
||
The HTML Help Project has licensed its software under LGPLv3 terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
REGEDIT4 | ||
|
||
[HKEY_CURRENT_USER\Software\Wine] | ||
"Version"="win2k" | ||
|
||
[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhc.exe\DllOverrides] | ||
"itircl"="native" | ||
"itss"="native" | ||
|
||
[HKEY_CURRENT_USER\Software\Wine\AppDefaults\hhw.exe\DllOverrides] | ||
"itircl"="native" | ||
"itss"="native" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
WINEPREFIX=${WINEPREFIX:=$HOME/.wine} | ||
|
||
test -d "$WINEPREFIX" || wineprefixcreate | ||
|
||
# Setup the registry | ||
wine regedit htmlhelp.reg | ||
|
||
# Install HTML Help Workshop | ||
wget 'http://go.microsoft.com/fwlink/?LinkId=14188' -O htmlhelp.exe | ||
wine htmlhelp.exe | ||
|
||
# Install ITSS.DLL | ||
cabextract -F hhupd.exe htmlhelp.exe | ||
cabextract -F itircl.dll hhupd.exe | ||
cabextract -F itss.dll hhupd.exe | ||
cp -a itircl.dll "$WINEPREFIX/drive_c/windows/system32/" | ||
cp -a itss.dll "$WINEPREFIX/drive_c/windows/system32/" | ||
wine regsvr32 /s 'C:\WINDOWS\SYSTEM32\itircl.dll' | ||
wine regsvr32 /s 'C:\WINDOWS\SYSTEM32\itss.dll' | ||
|
||
# Install MFC40.DLL | ||
wget -N http://activex.microsoft.com/controls/vc/mfc40.cab | ||
cabextract -F mfc40.exe mfc40.cab | ||
cabextract -F mfc40.dll mfc40.exe | ||
cp -a mfc40.dll "$WINEPREFIX/drive_c/windows/system32/" |