Skip to content

Commit

Permalink
Build documentation with hotdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
thiblahute committed Jan 9, 2019
1 parent da487fa commit 52d0ff7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,30 @@ install(
DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig
)

option(DOCUMENTATION "Build the documentation" OFF)
IF(DOCUMENTATION)
find_program(HAS_HOTDOC hotdoc)
IF(NOT HAS_HOTDOC)
message(FATAL_ERROR "hotdoc not found!")
ENDIF()

execute_process(
COMMAND hotdoc --has-extension c-extension
RESULT_VARIABLE HAS_HOTDOC_C_EXTENSION
)
IF("${HAS_HOTDOC_C_EXTENSION}" EQUAL 0)
add_custom_target(Documentation ALL
hotdoc run
--project-name=WPE
--project-version=1.0
--sitemap=${CMAKE_SOURCE_DIR}/docs/sitemap.txt
--output=${CMAKE_CURRENT_BINARY_DIR}/Documentation/
--c-sources="${CMAKE_SOURCE_DIR}/include/wpe/*.[ch]"
--extra-c-flags=-DWPE_COMPILATION=true
--c-include-directories ${CMAKE_SOURCE_DIR}/include ${DERIVED_SOURCES_DIR}/..
)
ELSE()
MESSAGE(FATAL_ERROR "Hotdoc C extension not found... can't build the documentation.")
ENDIF()
ENDIF()
1 change: 1 addition & 0 deletions docs/sitemap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c-index

0 comments on commit 52d0ff7

Please sign in to comment.