summaryrefslogtreecommitdiffstats
path: root/examples/make_docs_helper.sh
blob: ec5b0d4794684ea76a5c64658526670f5146f4f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
function go() {

PACKAGE_NAME=$1
PACKAGE_VERSION=$2
ARCHIVE_EXT=$3

URI_PREFIX="http://downloads.sourceforge.net/${PACKAGE_NAME}/"
URI_BASE="${PACKAGE_NAME}-${PACKAGE_VERSION}"
URI_FILE="${URI_BASE}${ARCHIVE_EXT}"
INI_FILE="${PACKAGE_NAME}.ini"
QCH_FILE="${PACKAGE_NAME}-${PACKAGE_VERSION}-doc.qch"
QHP_FILE="${PACKAGE_NAME}-${PACKAGE_VERSION}-doc.qhp"

HPP_FILE="html/index.hhp"
HPP_LOCATION="${URI_BASE}/doc/${HPP_FILE}"

## Download
if [ ! -f "${URI_FILE}" ]; then
    wget "${URI_PREFIX}${URI_FILE}" || exit 1
fi

## Unpack
if [ ! -d "${URI_BASE}" ]; then
    tar xf "${URI_FILE}"
fi

pushd "${URI_BASE}/doc" || exit 1

## Make temp file
TEMPFILE=`mktemp`
if [ "x${TEMPFILE}" = x ]; then
    popd ; exit 1
fi

## Fix Doxygen input
sed -e 's/^\(GENERATE_HTMLHELP\).\+$/\1 = YES/' -e 's/^\(HHC_LOCATION.\+\)$/# \1/' Doxyfile > "${TEMPFILE}"
rm Doxyfile
mv "${TEMPFILE}" Doxyfile || { popd ; exit 1 ; }

## Create Doxygen output
if [ ! -f "${HPP_FILE}" ]; then
    doxygen || { popd ; exit 1 ; }
fi

popd || exit 1


## Create Qt help files
LD_LIBRARY_PATH=$QTDIR/lib ../doxygen2qthelp "--config=${INI_FILE}" \
    --qch "${HPP_LOCATION}" "${QCH_FILE}" || exit 1

LD_LIBRARY_PATH=$QTDIR/lib ../doxygen2qthelp "--config=${INI_FILE}" \
    --qhp "${HPP_LOCATION}" "${QHP_FILE}" || exit 1

exit 0

}