diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2010-05-03 12:34:27 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2010-05-03 12:34:27 +0200 |
commit | 415b44ffb6ffcdeb4ad5b7cdd6d9d9e17ab3e47f (patch) | |
tree | d9417f99ef9665167668fe3047416a0d11e1518f /examples/make_docs_helper.sh |
Diffstat (limited to 'examples/make_docs_helper.sh')
-rw-r--r-- | examples/make_docs_helper.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/examples/make_docs_helper.sh b/examples/make_docs_helper.sh new file mode 100644 index 0000000..ec5b0d4 --- /dev/null +++ b/examples/make_docs_helper.sh @@ -0,0 +1,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 + +} + |