File: build-docs.patch

package info (click to toggle)
ne10 1.2.1-6
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 7,816 kB
  • sloc: ansic: 26,841; asm: 8,546; cpp: 2,428; python: 342; javascript: 136; sh: 135; objc: 105; xml: 63; java: 35; makefile: 12
file content (32 lines) | stat: -rw-r--r-- 1,028 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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()