summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-11-03 16:42:09 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-11-03 16:42:09 (GMT)
commitc812f3fea2c9bacfc0f2d2bcad6960e9aa640dcd (patch)
tree79245efc0218e670e8c5edd9eb0d57ad045f0633 /src
parentdc47bb7084d55993a0a6f3725dcf79d92d7f0e65 (diff)
downloadhdf5-c812f3fea2c9bacfc0f2d2bcad6960e9aa640dcd.zip
hdf5-c812f3fea2c9bacfc0f2d2bcad6960e9aa640dcd.tar.gz
hdf5-c812f3fea2c9bacfc0f2d2bcad6960e9aa640dcd.tar.bz2
Add doxygen auotoconf and cmake support
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt32
-rw-r--r--src/Makefile.am13
2 files changed, 43 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 597f620..7581ae5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1356,3 +1356,35 @@ if (NOT WIN32)
COMPONENT libraries
)
endif ()
+
+#-----------------------------------------------------------------------------
+# Option to build documentation
+#-----------------------------------------------------------------------------
+if (DOXYGEN_FOUND)
+ set (DOXYGEN_PACKAGE ${HDF5_PACKAGE})
+ set (DOXYGEN_VERSION_STRING ${HDF5_VERSION_STRING})
+ set (DOXYGEN_INCLUDE_ALIASES ${HDF5_DOXYGEN_DIR}/aliases)
+ set (DOXYGEN_PROJECT_LOGO ${HDF5_DOXYGEN_DIR}/img/HDFG-logo.png)
+ set (DOXYGEN_PROJECT_BRIEF "HDF5 (Hierarchical Data Format 5) Software Library and Utilities")
+ set (DOXYGEN_INPUT_DIRECTORY ${HDF5_SRC_DIR} ${HDF5_DOXYGEN_DIR}/dox ${HDF5_GENERATED_SOURCE_DIR}/shared)
+ set (DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
+ set (DOXYGEN_MACRO_EXPANSION YES)
+ set (DOXYGEN_OUTPUT_DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs)
+
+ # Replace variables inside @@ with the current values
+ configure_file(${HDF5_DOXYGEN_DIR}/Doxyfile.in Doxyfile @ONLY)
+
+ doxygen_add_docs(hdf5lib_doc
+# ${common_SRCS} ${shared_gen_SRCS} ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${HDF5_DOXYGEN_DIR}/dox
+ ${DOXYGEN_INPUT_DIRECTORY}
+ ALL
+ WORKING_DIRECTORY ${HDF5_SRC_DIR}
+ COMMENT "Generating HDF5 library Source Documentation"
+ )
+ install(
+ DIRECTORY ${HDF5_BINARY_DIR}/hdf5lib_docs/html
+ DESTINATION ${HDF5_INSTALL_DATA_DIR}
+ COMPONENT Documents
+ )
+
+endif ()
diff --git a/src/Makefile.am b/src/Makefile.am
index a333220..8645e9d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,7 +18,7 @@
include $(top_srcdir)/config/commence.am
include $(top_srcdir)/config/lt_vers.am
-
+include $(top_srcdir)/config/doxygen.am
# How to build H5detect for number format detection.
# Use -g to force no optimization since many compilers (e.g., Intel) takes
@@ -33,7 +33,7 @@ lib_LTLIBRARIES=libhdf5.la
libhdf5_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
# H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
-MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c
+MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c $(DX_CLEANFILES)
# H5pubconf.h is generated by configure, and should be cleaned.
DISTCLEANFILES=H5pubconf.h
@@ -201,6 +201,15 @@ $(top_srcdir)/src/H5version.h: $(top_srcdir)/src/H5vers.txt
$(top_srcdir)/src/H5overflow.h: $(top_srcdir)/src/H5overflow.txt
perl $(top_srcdir)/bin/make_overflow $?
+# doxygen support
+doxygen:
+ rm -fr $(top_builddir)/hdf5lib_docs
+ env $(DX_ENV) \
+ PROJECT_NAME="HDF5" \
+ SRCDIR=$(top_srcdir) \
+ OUTPUTDIR=$(top_builddir)/hdf5lib_docs \
+ $(DX_DOXYGEN) $(top_builddir)/$(DX_CONFIG)
+
# Add TRACE macros to library source files. This is done via the trace script
# in the hdf5/bin directory. If the file contains HDF5 API macros, a "clean"
# version of the source file is saved with a tilde (~) after its name and