No Description

FindSphinx.cmake 881B

12345678910111213141516171819202122232425262728293031
  1. find_program (SPHINX_EXECUTABLE NAMES sphinx-build
  2. HINTS $ENV{SPHINX_DIR}
  3. PATH_SUFFIXES bin
  4. DOC "Sphinx documentation html generator"
  5. )
  6. find_program (SPHINX_API_EXECUTABLE NAMES sphinx-apidoc
  7. HINTS $ENV{SPHINX_DIR}
  8. PATH_SUFFIXES bin
  9. DOC "Sphinx documentation rst generator"
  10. )
  11. include (FindPackageHandleStandardArgs)
  12. find_package_handle_standard_args (Sphinx DEFAULT_MSG
  13. SPHINX_EXECUTABLE
  14. SPHINX_API_EXECUTABLE
  15. )
  16. # Get Sphinx version
  17. if (SPHINX_EXECUTABLE)
  18. execute_process(COMMAND ${SPHINX_EXECUTABLE} --version
  19. OUTPUT_VARIABLE SPHINX_VERSION)
  20. if(SPHINX_VERSION)
  21. string(REGEX MATCH "([0-9]\\.[0-9]\\.[0-9])" SPHINX_VERSION_STR ${SPHINX_VERSION})
  22. message ("INFO - Sphinx version is " ${SPHINX_VERSION_STR})
  23. endif()
  24. endif ()
  25. mark_as_advanced (SPHINX_EXECUTABLE)
  26. mark_as_advanced (SPHINX_API_EXECUTABLE)