CMakeLists.txt raw
1 # Copyright (c) 2024-present The Bitcoin Core developers
2 # Distributed under the MIT software license, see the accompanying
3 # file COPYING or https://opensource.org/license/mit/.
4
5 find_package(Doxygen COMPONENTS dot)
6
7 if(DOXYGEN_FOUND)
8 set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
9 configure_file(Doxyfile.in ${doxyfile} USE_SOURCE_PERMISSIONS)
10
11 # In CMake 3.27, The FindDoxygen module's doxygen_add_docs()
12 # command gained a CONFIG_FILE option to specify a custom doxygen
13 # configuration file.
14 # TODO: Consider using it.
15 add_custom_target(docs
16 COMMAND Doxygen::doxygen ${doxyfile}
17 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
18 COMMENT "Generating developer documentation"
19 VERBATIM USES_TERMINAL
20 )
21 else()
22 add_custom_target(docs
23 COMMAND ${CMAKE_COMMAND} -E echo "Error: Doxygen not found"
24 )
25 endif()
26