Radek Krejci | 88ad4be | 2020-10-03 12:27:05 +0200 | [diff] [blame] | 1 | # Prepare building doxygen documentation |
Michal Vasko | 3b62f3b | 2021-05-25 08:53:38 +0200 | [diff] [blame] | 2 | macro(GEN_DOC INPUT_FILES PROJECT_VERSION PROJECT_DESCRIPTION DOC_LOGO) |
Radek Krejci | 88ad4be | 2020-10-03 12:27:05 +0200 | [diff] [blame] | 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() |
Michal Vasko | 3b62f3b | 2021-05-25 08:53:38 +0200 | [diff] [blame] | 12 | |
| 13 | # target doc |
Radek Krejci | 88ad4be | 2020-10-03 12:27:05 +0200 | [diff] [blame] | 14 | add_custom_target(doc |
| 15 | COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile |
| 16 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) |
Michal Vasko | 3b62f3b | 2021-05-25 08:53:38 +0200 | [diff] [blame] | 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 | |
Radek Krejci | 88ad4be | 2020-10-03 12:27:05 +0200 | [diff] [blame] | 26 | configure_file(Doxyfile.in Doxyfile) |
| 27 | endif() |
| 28 | endmacro() |