From b93ca30f030a4ddb88e8942e0c888c50d0af5ad0 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sun, 6 Jan 2019 16:27:38 +0100 Subject: [PATCH] Build documentation with hotdoc --- CMakeLists.txt | 20 ++++++++++++++++++++ docs/sitemap.txt | 1 + 2 files changed, 21 insertions(+) create mode 100644 docs/sitemap.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0545be69..cfdabc5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,3 +107,23 @@ install( DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) + +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("Hotdoc C extension not found... not building documentation.") +ENDIF() diff --git a/docs/sitemap.txt b/docs/sitemap.txt new file mode 100644 index 00000000..03c4a19b --- /dev/null +++ b/docs/sitemap.txt @@ -0,0 +1 @@ +c-index \ No newline at end of file