2019-08-03 10:37:37 +00:00
|
|
|
find_package(Doxygen REQUIRED)
|
|
|
|
|
|
|
|
# Find all the public headers
|
2019-08-06 07:46:02 +00:00
|
|
|
get_target_property(WRMATH_PUBLIC_HEADER_DIR wrmath INTERFACE_INCLUDE_DIRECTORIES)
|
2019-08-03 10:37:37 +00:00
|
|
|
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")
|
|
|
|
|
2019-08-08 03:51:22 +00:00
|
|
|
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")
|