Michal Vasko | 4e6d324 | 2021-05-26 09:13:24 +0200 | [diff] [blame] | 1 | # Prepare building doxygen documentation |
| 2 | macro(GEN_DOC INPUT_FILES PROJECT_VERSION PROJECT_DESCRIPTION DOC_LOGO) |
| 3 | find_package(Doxygen) |
| 4 | if(DOXYGEN_FOUND) |
| 5 | find_program(DOT_PATH dot PATH_SUFFIXES graphviz2.38/bin graphviz/bin) |
| 6 | if(DOT_PATH) |
| 7 | set(HAVE_DOT "YES") |
| 8 | else() |
| 9 | set(HAVE_DOT "NO") |
| 10 | message(AUTHOR_WARNING "Doxygen: to generate UML diagrams please install graphviz") |
| 11 | endif() |
| 12 | |
| 13 | # target doc |
| 14 | add_custom_target(doc |
| 15 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile |
| 16 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
| 17 | |
| 18 | # generate list with spaces as separators |
| 19 | string(REPLACE ";" " " DOXY_INPUT "${INPUT_FILES}") |
| 20 | |
| 21 | # make other arguments into variables |
| 22 | set(PROJECT_VERSION ${PROJECT_VERSION}) |
| 23 | set(PROJECT_DESCRIPTION ${PROJECT_DESCRIPTION}) |
| 24 | set(DOC_LOGO ${DOC_LOGO}) |
| 25 | |
| 26 | configure_file(Doxyfile.in Doxyfile) |
| 27 | endif() |
| 28 | endmacro() |