summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2020-05-05 12:12:21 +0200
committerAlberto Compagno <acompagn+fdio@cisco.com>2020-05-06 16:44:34 +0200
commit485474ec0bcd5fd73743a040cbad326a458e6390 (patch)
treebca81977a66d96f9e0a29e2e522a64f93d7767f0 /docs
parent43d0ecbb1a1f7e1f72bf85441547b1678aed4350 (diff)
[HICN-606] Added doxygen documentation
Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com> Change-Id: If2bf7f4f310adf6adbbb9ea29eafcb2a0ee40d54
Diffstat (limited to 'docs')
-rw-r--r--docs/doxygen/CMakeLists.txt35
-rw-r--r--docs/doxygen/Doxyfile.in12
2 files changed, 47 insertions, 0 deletions
diff --git a/docs/doxygen/CMakeLists.txt b/docs/doxygen/CMakeLists.txt
new file mode 100644
index 000000000..8da74995b
--- /dev/null
+++ b/docs/doxygen/CMakeLists.txt
@@ -0,0 +1,35 @@
+# add a target to generate API documentation with Doxygen
+find_package(Doxygen)
+option(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
+
+if(BUILD_DOCUMENTATION)
+ if(NOT DOXYGEN_FOUND)
+ message(FATAL_ERROR "Doxygen is needed to build the documentation.")
+ endif()
+
+ set(doxy_main_page ${CMAKE_CURRENT_SOURCE_DIR}/../../README.md)
+ set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
+ set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+ # extract version from git
+ execute_process(
+ COMMAND git describe --long --match v*
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ OUTPUT_VARIABLE VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ if (NOT VERSION)
+ set(VERSION "v1.0-1-gcafe")
+ endif()
+
+ configure_file(${doxyfile_in} ${doxyfile} @ONLY)
+
+ add_custom_target(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen"
+ VERBATIM)
+
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc OPTIONAL)
+endif()
diff --git a/docs/doxygen/Doxyfile.in b/docs/doxygen/Doxyfile.in
new file mode 100644
index 000000000..6f152323d
--- /dev/null
+++ b/docs/doxygen/Doxyfile.in
@@ -0,0 +1,12 @@
+PROJECT_NAME = "Hybrid ICN (hICN) plugin"
+PROJECT_NUMBER = @VERSION@
+STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \
+ @PROJECT_BINARY_DIR@
+INPUT = @doxy_main_page@ \
+ @PROJECT_SOURCE_DIR@ \
+ @PROJECT_BINARY_DIR@
+FILE_PATTERNS = *.md \
+ *.h \
+ *.hpp
+RECURSIVE = YES
+USE_MDFILE_AS_MAINPAGE = @doxy_main_page@