Skip to content

Commit

Permalink
better checking + warnings for doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-chrismc committed Dec 27, 2023
1 parent 0ff1036 commit 4fdf88e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,20 @@ file(DOWNLOAD https://raw.githubusercontent.com/jothepro/doxygen-awesome-css/v2.
${CMAKE_CURRENT_LIST_DIR}/doxygen-awesome-sidebar-only.css
EXPECTED_HASH SHA256=998328b27193b7be007a431bc9be1a6f6855ff4d8fa722ecfdfed79a8931409f)

add_custom_target(build_docs COMMAND doxygen ${CMAKE_CURRENT_LIST_DIR}/Doxyfile WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
SOURCES ${CMAKE_CURRENT_LIST_DIR}/Doxyfile BYPRODUCTS ${CMAKE_BINARY_DIR}/html/index.html)
execute_process(COMMAND doxygen --version RESULT_VARIABLE DOXYGEN_VERSION_RESULT
OUTPUT_VARIABLE DOXYGEN_VERSION_RAW_OUTPUT)
if(NOT DOXYGEN_VERSION_RESULT EQUAL 0)
message(AUTHOR_WARNING "Unable to get the version of doxygen")
else()
# Extracts the version from the output of the command run before
string(REGEX MATCH "^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)" DOXYGEN_VERSION_OUTPUT
"${DOXYGEN_VERSION_RAW_OUTPUT}")
message(STATUS "doxygen version detected : ${DOXYGEN_VERSION_OUTPUT}")
endif()

add_custom_target(
build_docs COMMAND doxygen ${CMAKE_CURRENT_LIST_DIR}/Doxyfile WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
SOURCES ${CMAKE_CURRENT_LIST_DIR}/Doxyfile BYPRODUCTS ${CMAKE_BINARY_DIR}/html/index.html)
add_custom_command(
TARGET build_docs POST_BUILD COMMAND ${CMAKE_COMMAND} -E cmake_echo_color --cyan
"You can prview the documentation: ${CMAKE_BINARY_DIR}/html/index.html")

0 comments on commit 4fdf88e

Please sign in to comment.