Skip to content

Commit 734f2ac

Browse files
authored
Merge pull request #41 from thiblahute/doc
Build documentation with hotdoc
2 parents da487fa + b1512d5 commit 734f2ac

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

CMakeLists.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,31 @@ install(
107107
DESTINATION
108108
${CMAKE_INSTALL_LIBDIR}/pkgconfig
109109
)
110+
111+
option(BUILD_DOCS "Build the documentation" OFF)
112+
IF(BUILD_DOCS)
113+
find_program(HOTDOC hotdoc)
114+
IF(NOT HOTDOC)
115+
message(FATAL_ERROR "hotdoc not found!")
116+
ENDIF()
117+
118+
execute_process(
119+
COMMAND ${HOTDOC} --has-extension c-extension
120+
RESULT_VARIABLE HAS_HOTDOC_C_EXTENSION
121+
)
122+
IF("${HAS_HOTDOC_C_EXTENSION}" EQUAL 0)
123+
add_custom_target(Documentation ALL
124+
${HOTDOC} run
125+
--project-name=WPE
126+
--project-version=1.0
127+
--sitemap=${CMAKE_SOURCE_DIR}/docs/sitemap.txt
128+
--output=${CMAKE_CURRENT_BINARY_DIR}/Documentation/
129+
--c-sources="${CMAKE_SOURCE_DIR}/include/wpe/*.[ch]"
130+
--extra-c-flags=-DWPE_COMPILATION=true
131+
--c-include-directories ${CMAKE_SOURCE_DIR}/include ${DERIVED_SOURCES_DIR}/..
132+
--c-smart-index
133+
)
134+
ELSE()
135+
MESSAGE(FATAL_ERROR "Hotdoc C extension not found... can't build the documentation.")
136+
ENDIF()
137+
ENDIF()

docs/sitemap.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
c-index

0 commit comments

Comments
 (0)