added support for PlantUML in Doxygen using AX_USE_PLANTUML and in doxygen use @startuml{image.png}...@enduml

master
Marc Wäckerlin 8 years ago
parent b57f37d33c
commit 5ab3f68198
  1. 26
      scripts/ax_init_standard_project.m4
  2. 26
      scripts/bootstrap.sh
  3. BIN
      scripts/doc/plantuml.jar

@ -543,11 +543,22 @@ AC_DEFUN([AX_USE_SCRIPTS], [
AC_CONFIG_FILES([scripts/makefile])
])
# use this in configure.ac to support PlantUML in Doxygen generation
AC_DEFUN([AX_USE_PLANTUML], [
])
# use this in configure.ac to support Doxygen documentation generation
AC_DEFUN([AX_USE_DOXYGEN], [
AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
AC_CHECK_PROG(have_dot, dot, yes, no)
AC_CHECK_PROG(have_mscgen, mscgen, yes, no)
if test -f "${srcdir}/doc/plantuml.jar"; then
PLANTUML="doc/plantuml.jar"
AX_SUBST(PLANTUML)
else
AC_MSG_ERROR([NOT FOUND ac_top_srcdir=${ac_top_srcdir} top_srcdir=${top_srcdir} srcdir=${srcdir}])
fi
AM_CONDITIONAL(HAVE_PLANTUML, test -n "$PLANTUML")
PDF_DOC=${PACKAGE_NAME}-${PACKAGE_VERSION}.pdf
AC_SUBST(PDF_DOC)
if test "$have_doxygen" = "no"; then
@ -569,17 +580,26 @@ AC_DEFUN([AX_USE_DOXYGEN], [
AX_ADD_MAKEFILE_TARGET_DEP([install-data-am], [install-data-documentation], [doc/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([uninstall-am], [uninstall-documentation], [doc/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([all], [doc], [doc/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [pdf], [doc/makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [pdf images], [doc/makefile.in])
test -f doc/makefile.in && cat >> doc/makefile.in <<EOF
#### Begin: Appended by $0
doc: doxyfile
doc: doxyfile @HAVE_PLANTUML_TRUE@ gen-uml-images
doxygen doxyfile
@PEDANTIC_TRUE@ test \! -s doxygen.errors
@HAVE_PLANTUML_TRUE@gen-uml-images:
@HAVE_PLANTUML_TRUE@ test -d gen-uml-images || mkdir gen-uml-images
@HAVE_PLANTUML_TRUE@ eval \$\$(sed -n 's, *INPUT *\\(+\\?\\)= *\\(.*\\),INPUT\\1=" \\2",gp' doxyfile); \\
@HAVE_PLANTUML_TRUE@ eval \$\$(sed -n 's, *FILE_PATTERNS *\\(+\\?\\)= *\\(.*\\),FILE_PATTERNS\\1=" \\2",gp' doxyfile); \\
@HAVE_PLANTUML_TRUE@ SOURCES="**.("\$\$(echo \$\${FILE_PATTERNS} | sed 's,*.,,g;s, ,|,g')")"; \\
@HAVE_PLANTUML_TRUE@ for src in \$\$INPUT; do \\
@HAVE_PLANTUML_TRUE@ java -Djava.awt.headless=true -jar \${top_srcdir}/\${PLANTUML} -v -o \$\$(pwd)/gen-uml-images "\$\$src/\$\$SOURCES"; \\
@HAVE_PLANTUML_TRUE@ done
clean-documentation:
-rm doxygen.errors @PDF_DOC@
distclean-documentation:
-rm -r html
-rm -r html gen-uml-images
-rm @PACKAGE_NAME@.doxytag
maintainer-clean-documentation:
-rm makefile.in

@ -154,6 +154,7 @@ GENERATED FILES
* doc/header.html.in - if you enabled AX_USE_DOXYGEN
* doc/footer.html.in - if you enabled AX_USE_DOXYGEN
* doc/style.css - if you enabled AX_USE_DOXYGEN
* doc/plantuml.jar - if you enable AX_USE_PLANTUML
* test/makefile.am - if you enabled AX_USE_CPPUNIT and AX_USE_CXX
* test/${DEFAULT_PROJECT_NAME#lib}.cxx - if you enabled AX_BUILD_TEST or AX_USE_CPPUNIT
* examples/makefile.am - if you enabled AX_BUILD_EXAMPLES
@ -242,6 +243,11 @@ FILES
* Enable LibTool library creation: AX_USE_LIBTOOL
* Enable Scripts: AX_USE_SCRIPTS
* Enable Doxygen documentation generation: AX_USE_DOXYGEN
* Enable PlantUML for Doxygen: AX_USE_PLANTUML
Example, add in doxygen documentation:
@startuml{overview.png}
Alice -> Bob: test
@enduml
* Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING
* Enable RPM packaging by calling "make rpm": AX_USE_RPM_PACKAGING
* Enable C++ testing using CppUnit: AX_USE_CPPUNIT
@ -439,6 +445,9 @@ copy() {
source="${0%/*}/$1"
fi
fi
if test "${1%/*}" != "$1"; then
test -d "${1%/*}" || svn mkdir "${1%/*}"
fi
run cp "${source}" "$1"
if test $exists -eq 0; then
if test -n "${VCS}" -a $novcs -eq 0 && ! contains "$1" "${excludevcs[@]}"; then
@ -546,6 +555,7 @@ AX_INIT_STANDARD_PROJECT
#AX_USE_LIBTOOL
#AX_USE_SCRIPTS
#AX_USE_DOXYGEN
#AX_USE_PLANTUML
#AX_USE_DEBIAN_PACKAGING
#AX_USE_RPM_PACKAGING
#AX_USE_CPPUNIT
@ -965,6 +975,9 @@ to --condition AX_USE_DOXYGEN doc/style.css <<EOF
margin: 0;
}
EOF
if testtag AX_USE_PLANTUML; then
copy doc/plantuml.jar
fi
if testtag AX_USE_DOXYGEN; then
if ! checkfile doc/doxyfile.in || \
contains doc/doxyfile.in "${rebuildfiles[@]}"; then
@ -994,6 +1007,11 @@ if testtag AX_USE_DOXYGEN; then
doxyadd ALIASES '"description=@DESCRIPTION@"'
doxyadd ALIASES '"readme=@README_HTML@"'
doxyadd ALIASES '"author=<a href="@AUTHOR_URL@" target="_blank">@AUTHOR_NAME@</a>"'
if testtag AX_USE_PLANTUML; then
doxyadd ALIASES '"startuml{1}=\\image html \\1\\n\\image latex \\1\\n\\if DontIgnorePlantUMLCode"'
doxyadd ALIASES '"enduml=\\endif"'
doxyadd IMAGE_PATH '"gen-uml-images"'
fi
doxyreplace ENABLE_PREPROCESSING YES
doxyreplace MACRO_EXPANSION YES
doxyadd PREDEFINED '"NAMESPACE=@PACKAGE_NAME@"'
@ -1067,7 +1085,7 @@ if testtag AX_USE_DEBIAN_PACKAGING; then
-- @AUTHOR@ @BUILD_DATE@
EOF
BUILD_DEPENDS="debhelper, ${VCSDEPENDS} pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | libqt4-core | libqtcore4, qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)"
BUILD_DEPENDS="debhelper, ${VCSDEPENDS} pkg-config, automake, libtool, autotools-dev, pandoc, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_USE_PLANTUML; then echo -n ", default-jre-headless|default-jre"; fi; if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-dev"; fi; if testtag AX_CXX_QT || testtag AX_CHECK_QT AX_REQUIRE_QT; then echo -n ", qt5-default | libqt4-core | libqtcore4, qt5-qmake | qt4-qmake, qtbase5-dev | libqt4-dev, qtbase5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools, qttools5-dev-tools | qt4-dev-tools"; fi)"
to debian/control.in <<EOF
Source: @PACKAGE_NAME@
Priority: extra
@ -1141,7 +1159,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: gnupg, ${VCSDEPENDS} make, automake, autoconf, rpm-build$(
if testtag AX_USE_DOXYGEN; then
echo -n ", doxygen";
fi)
fi
if testtag AX_USE_PLANTUML; then
echo -n ", default-jre-headless";
fi
)
%if 0%{?fedora} != 20
$(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: graphviz"; fi)
%endif

Binary file not shown.
Loading…
Cancel
Save