From 22a09a53e6aacbaf40d2d975b170a0515d212e2f Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 24 Feb 2016 10:23:06 +0100 Subject: [PATCH] Centralize documentation generation logic --- CMakeLists.txt | 8 -------- docs/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++-- docs/Doxyfile.in | 18 +----------------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ddaa518b..d3d277b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,10 +71,6 @@ find_package(Vulkan) if (GLFW_BUILD_DOCS) set(DOXYGEN_SKIP_DOT TRUE) find_package(Doxygen) - - if (GLFW_DOCUMENT_INTERNALS) - set(GLFW_INTERNAL_DOCS "${GLFW_SOURCE_DIR}/src/internal.h ${GLFW_SOURCE_DIR}/docs/internal.dox") - endif() endif() #-------------------------------------------------------------------- @@ -369,10 +365,6 @@ write_basic_package_version_file(src/glfw3ConfigVersion.cmake VERSION ${GLFW_VERSION_FULL} COMPATIBILITY SameMajorVersion) -if (GLFW_BUILD_DOCS) - configure_file(docs/Doxyfile.in docs/Doxyfile @ONLY) -endif() - configure_file(src/glfw_config.h.in src/glfw_config.h @ONLY) configure_file(src/glfw3.pc.in src/glfw3.pc @ONLY) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 45a6162e..063aa48a 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,5 +1,33 @@ -add_custom_target(docs ALL ${DOXYGEN_EXECUTABLE} - WORKING_DIRECTORY ${GLFW_BINARY_DIR}/docs +set(glfw_DOCS_SOURCES + "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" + "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h" + "${GLFW_SOURCE_DIR}/docs/main.dox" + "${GLFW_SOURCE_DIR}/docs/news.dox" + "${GLFW_SOURCE_DIR}/docs/moving.dox" + "${GLFW_SOURCE_DIR}/docs/quick.dox" + "${GLFW_SOURCE_DIR}/docs/compile.dox" + "${GLFW_SOURCE_DIR}/docs/build.dox" + "${GLFW_SOURCE_DIR}/docs/intro.dox" + "${GLFW_SOURCE_DIR}/docs/context.dox" + "${GLFW_SOURCE_DIR}/docs/monitor.dox" + "${GLFW_SOURCE_DIR}/docs/window.dox" + "${GLFW_SOURCE_DIR}/docs/input.dox" + "${GLFW_SOURCE_DIR}/docs/vulkan.dox" + "${GLFW_SOURCE_DIR}/docs/rift.dox" + "${GLFW_SOURCE_DIR}/docs/compat.dox") + +if (GLFW_DOCUMENT_INTERNALS) + list(APPEND glfw_DOCS_SOURCES "${GLFW_SOURCE_DIR}/src/internal.h") +endif() + +foreach(arg ${glfw_DOCS_SOURCES}) + set(GLFW_DOCS_SOURCES "${GLFW_DOCS_SOURCES} ${arg}") +endforeach() + +configure_file(Doxyfile.in Doxyfile @ONLY) + +add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}" + WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs" COMMENT "Generating HTML documentation" VERBATIM) diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index 696cb2cf..b046f898 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -660,23 +660,7 @@ WARN_LOGFILE = @GLFW_BINARY_DIR@/docs/warnings.txt # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = @GLFW_INTERNAL_DOCS@ \ - @GLFW_SOURCE_DIR@/include/GLFW/glfw3.h \ - @GLFW_SOURCE_DIR@/include/GLFW/glfw3native.h \ - @GLFW_SOURCE_DIR@/docs/main.dox \ - @GLFW_SOURCE_DIR@/docs/news.dox \ - @GLFW_SOURCE_DIR@/docs/moving.dox \ - @GLFW_SOURCE_DIR@/docs/quick.dox \ - @GLFW_SOURCE_DIR@/docs/compile.dox \ - @GLFW_SOURCE_DIR@/docs/build.dox \ - @GLFW_SOURCE_DIR@/docs/intro.dox \ - @GLFW_SOURCE_DIR@/docs/context.dox \ - @GLFW_SOURCE_DIR@/docs/monitor.dox \ - @GLFW_SOURCE_DIR@/docs/window.dox \ - @GLFW_SOURCE_DIR@/docs/input.dox \ - @GLFW_SOURCE_DIR@/docs/vulkan.dox \ - @GLFW_SOURCE_DIR@/docs/rift.dox \ - @GLFW_SOURCE_DIR@/docs/compat.dox +INPUT = @GLFW_DOCS_SOURCES@ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is