UseSphinx.cmake 854 B

12345678910111213141516171819202122232425262728293031323334
  1. macro(buildSphinxDoc)
  2. if(DOXYGEN_FOUND AND breathe_FOUND)
  3. set(SPHINX_IN ${CMAKE_SOURCE_DIR}/docs/conf.py.in)
  4. set(SPHINX_OUT ${CMAKE_BINARY_DIR}/Documentation/Sphinx/_build/conf.py)
  5. # BREATHE_DOC_CONF_FILE中的Sphinx模板文件,会通过conf.py配置到的BREATHE_DOC_BUILD_DIR目录下
  6. configure_file(
  7. ${SPHINX_IN}
  8. ${SPHINX_OUT}
  9. @ONLY
  10. )
  11. # note the option ALL which allows to build the docs together with the application
  12. add_custom_target(Sphinx ALL
  13. COMMAND
  14. ${SPHINX_EXECUTABLE}
  15. -q
  16. -b html
  17. -c ${CMAKE_BINARY_DIR}/Documentation/Sphinx/_build
  18. ${CMAKE_SOURCE_DIR}/docs
  19. ${CMAKE_BINARY_DIR}/Documentation/Sphinx/html
  20. COMMENT
  21. "Building Sphinx documentation with Breathe, Sphinx and Doxygen"
  22. VERBATIM
  23. )
  24. set_target_properties(Sphinx
  25. PROPERTIES
  26. FOLDER Documentation
  27. )
  28. endif()
  29. endmacro()
  30. buildSphinxDoc()