Index: ne10-1.2.1/CMakeLists.txt
===================================================================
--- ne10-1.2.1.orig/CMakeLists.txt
+++ ne10-1.2.1/CMakeLists.txt
@@ -170,6 +170,27 @@ set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
 # Add NE10 library sub-directory.
 add_subdirectory(modules)
 
+# Build documentation
+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 (doxyfile ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen/doxygen.cfg)
+
+    add_custom_target(
+      doc ALL
+      COMMAND ${DOXYGEN_EXECUTABLE}  ${doxyfile}
+      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/doxygen
+      COMMENT "Generating API documentation with Doxygen"
+      VERBATIM
+    )
+endif(BUILD_DOCUMENTATION)
+
 if(NE10_BUILD_EXAMPLES AND NE10_ENABLE_MATH)
     add_subdirectory(samples)
 endif()
