yang.li | d6fe624 | 2022-01-13 14:44:24 +0800 | [diff] [blame] | 1 | # Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved. |
| 2 | |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | |
bin.chen | 1a426d3 | 2021-10-13 10:52:36 +0800 | [diff] [blame] | 5 | # set input and output files |
| 6 | set(DOXYGEN_IN ${SDK_BASE}/doc/Doxyfile) |
| 7 | set(DOXYGEN_OUT ${PROJECT_BINARY_DIR}/Doxyfile) |
| 8 | |
| 9 | # check if Doxygen is installed |
| 10 | find_package(Doxygen) |
| 11 | if (DOXYGEN_FOUND) |
| 12 | |
| 13 | # request to configure the file |
| 14 | configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) |
| 15 | message("Doxygen build started") |
| 16 | |
| 17 | # note the option ALL which allows to build the docs together with the application |
| 18 | add_custom_target( doc_doxygen ALL |
| 19 | COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} |
| 20 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR} |
| 21 | COMMENT "Generating API documentation with Doxygen" |
| 22 | VERBATIM ) |
| 23 | else (DOXYGEN_FOUND) |
| 24 | message("Doxygen need to be installed to generate the doxygen documentation") |
| 25 | endif (DOXYGEN_FOUND) |