From 6cabb3e30182f068a7d68280801ef9c47d7a047f Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 17 Aug 2020 17:54:42 +0100 Subject: [PATCH] add doxygen to the build system configure tests for it, make runs it, make install copies the generated html --- configure.ac | 16 ++++++++++++---- cplusplus/.gitignore | 2 ++ cplusplus/{Doxyfile => Doxyfile.in} | 2 +- cplusplus/Makefile.am | 18 +++++++++++++++++- 4 files changed, 32 insertions(+), 6 deletions(-) rename cplusplus/{Doxyfile => Doxyfile.in} (99%) diff --git a/configure.ac b/configure.ac index cbfa85ac..4ae8256b 100644 --- a/configure.ac +++ b/configure.ac @@ -239,6 +239,12 @@ AC_PROG_INSTALL AC_PROG_LN_S AM_WITH_DMALLOC +AC_CHECK_PROGS([DOXYGEN], [doxygen]) +if test -z "$DOXYGEN"; then + AC_MSG_WARN([doxygen not found; C++ docs will not be generated]) +fi +AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) + # we need a fully expanded version of $libdir # without this we get something like # define VIPS_LIBDIR ${exec_prefix}/lib @@ -248,11 +254,11 @@ test x"$exec_prefix" = x"NONE" && exec_prefix='${prefix}' # set $expanded_value to the fully-expanded value of the argument expand () { - eval expanded_value=$1 + eval expanded_value=$1 - if test x"$expanded_value" != x"$1"; then - expand "$expanded_value" - fi + if test x"$expanded_value" != x"$1"; then + expand "$expanded_value" + fi } expand $libdir @@ -1345,6 +1351,7 @@ AC_CONFIG_FILES([ libvips/mosaicing/Makefile libvips/create/Makefile libvips/resample/Makefile + cplusplus/Doxyfile cplusplus/include/Makefile cplusplus/include/vips/Makefile cplusplus/Makefile @@ -1379,6 +1386,7 @@ gobject introspection: $found_introspection enable radiance support: $with_radiance enable analyze support: $with_analyze enable PPM support: $with_ppm +generate C++ docs: $DOXYGEN * optional dependencies use fftw3 for FFT: $with_fftw diff --git a/cplusplus/.gitignore b/cplusplus/.gitignore index 1936cc1d..2f437dc2 100644 --- a/cplusplus/.gitignore +++ b/cplusplus/.gitignore @@ -1 +1,3 @@ html +Doxyfile +doxygen.stamp diff --git a/cplusplus/Doxyfile b/cplusplus/Doxyfile.in similarity index 99% rename from cplusplus/Doxyfile rename to cplusplus/Doxyfile.in index da9fa039..1eb09848 100644 --- a/cplusplus/Doxyfile +++ b/cplusplus/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "vips-cpp" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "8.11" +PROJECT_NUMBER = "@VIPS_MAJOR_VERSION@.@VIPS_MINOR_VERSION@" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/cplusplus/Makefile.am b/cplusplus/Makefile.am index 3156040f..4d123948 100644 --- a/cplusplus/Makefile.am +++ b/cplusplus/Makefile.am @@ -28,8 +28,24 @@ vips-operators.cpp: echo "// this file is generated automatically, do not edit!" >> vips-operators.cpp; \ ./gen-operators.py -g cpp >> vips-operators.cpp +if HAVE_DOXYGEN + +html_DATA = html + +html: doxygen.stamp + +doxygen.stamp: Doxyfile + $(DOXYGEN) $^ + touch doxygen.stamp + +install-htmlDATA: + -mkdir -p $(DESTDIR)$(htmldir) + -cp -r html $(DESTDIR)$(htmldir) + +endif + EXTRA_DIST = \ README \ vips-operators.cpp \ - Doxyfile \ + Doxyfile.in \ gen-operators.py