1 2# NOTE: The order of this list determines the order of items in the Guides 3# (i.e. Pages) list in the generated documentation 4set(source_files 5 main.md 6 news.md 7 quick.md 8 moving.md 9 compile.md 10 build.md 11 intro.md 12 context.md 13 monitor.md 14 window.md 15 input.md 16 vulkan.md 17 compat.md 18 internal.md) 19 20set(extra_files DoxygenLayout.xml header.html footer.html extra.css spaces.svg) 21 22set(header_paths 23 "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h" 24 "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h") 25 26# Format the source list into a Doxyfile INPUT value that Doxygen can parse 27foreach(path IN LISTS header_paths) 28 string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${path}\"") 29endforeach() 30foreach(file IN LISTS source_files) 31 string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"") 32endforeach() 33 34set(DOXYGEN_SKIP_DOT TRUE) 35find_package(Doxygen) 36 37if (NOT DOXYGEN_FOUND OR DOXYGEN_VERSION VERSION_LESS "1.9.8") 38 message(STATUS "Documentation generation requires Doxygen 1.9.8 or later") 39else() 40 configure_file(Doxyfile.in Doxyfile @ONLY) 41 add_custom_command(OUTPUT "html/index.html" 42 COMMAND "${DOXYGEN_EXECUTABLE}" 43 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" 44 MAIN_DEPENDENCY Doxyfile 45 DEPENDS ${header_paths} ${source_files} ${extra_files} 46 COMMENT "Generating HTML documentation" 47 VERBATIM) 48 49 add_custom_target(docs ALL SOURCES "html/index.html") 50 set_target_properties(docs PROPERTIES FOLDER "GLFW3") 51 52 if (GLFW_INSTALL) 53 install(DIRECTORY "${GLFW_BINARY_DIR}/docs/html" 54 DESTINATION "${CMAKE_INSTALL_DOCDIR}") 55 endif() 56endif() 57 58