CMakeLists.txt 918 B

1234567891011121314151617181920212223242526
  1. find_program(DOXYGEN doxygen
  2. PATHS "$ENV{ProgramFiles}/doxygen/bin"
  3. "$ENV{ProgramFiles\(x86\)}/doxygen/bin")
  4. if (NOT DOXYGEN)
  5. message(STATUS "Target 'doc' disabled (requires doxygen)")
  6. return ()
  7. endif ()
  8. # Find the Python interpreter and set the PYTHON_EXECUTABLE variable.
  9. if (CMAKE_VERSION VERSION_LESS 3.12)
  10. # This logic is deprecated in CMake after 3.12.
  11. find_package(PythonInterp QUIET REQUIRED)
  12. else ()
  13. find_package(Python QUIET REQUIRED)
  14. set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
  15. endif ()
  16. add_custom_target(doc
  17. COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/build.py
  18. ${FMT_VERSION}
  19. SOURCES api.rst syntax.rst usage.rst build.py conf.py _templates/layout.html)
  20. include(GNUInstallDirs)
  21. install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
  22. DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/fmt OPTIONAL
  23. PATTERN ".doctrees" EXCLUDE)