CMakeLists.txt 1.9 KB

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