30 lines
1.0 KiB
CMake
30 lines
1.0 KiB
CMake
find_package(Doxygen REQUIRED)
|
|
|
|
# Find all the public headers
|
|
get_target_property(WRMATH_PUBLIC_HEADER_DIR wrmath INTERFACE_INCLUDE_DIRECTORIES)
|
|
file(GLOB_RECURSE WRMATH_PUBLIC_HEADERS ${WRMATH_PUBLIC_HEADER_DIR}/*.h)
|
|
|
|
#This will be the main output of our command
|
|
set(DOXYGEN_INDEX_FILE ${CMAKE_CURRENT_SOURCE_DIR}/html/index.html)
|
|
|
|
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
|
|
DEPENDS ${WRMATH_PUBLIC_HEADERS}
|
|
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
MAIN_DEPENDENCY Doxyfile
|
|
COMMENT "Generating docs")
|
|
|
|
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE})
|
|
|
|
find_package(Sphinx REQUIRED)
|
|
|
|
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sphinx)
|
|
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/docs)
|
|
|
|
add_custom_target(Sphinx ALL
|
|
COMMAND
|
|
${SPHINX_EXECUTABLE} -b html
|
|
${SPHINX_SOURCE} ${SPHINX_BUILD}
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
COMMENT "Generating documentation with Sphinx")
|