summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-11-13 15:30:56 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-11-13 15:30:56 (GMT)
commit3e45af68d8f40e486d2fca1583056798b72dca91 (patch)
treee6937760637d5c45aa380f0da57b1f85fbe83c82 /src/CMakeLists.txt
parent46bc76ab634ed418c51c4dc50741533027a9cec9 (diff)
downloadhdf5-3e45af68d8f40e486d2fca1583056798b72dca91.zip
hdf5-3e45af68d8f40e486d2fca1583056798b72dca91.tar.gz
hdf5-3e45af68d8f40e486d2fca1583056798b72dca91.tar.bz2
Add doxygen framework for CMake and autotools
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 597f620..38225e9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1356,3 +1356,41 @@ 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 "C-API Reference")
+ 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
+ )
+
+ if(NOT TARGET doxygen)
+ add_custom_target(doxygen)
+ endif()
+
+ add_dependencies(doxygen hdf5lib_doc)
+
+endif ()