aboutsummaryrefslogtreecommitdiff
path: root/doc/CMakeLists.txt
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-04-23 15:44:20 +0100
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2024-08-16 21:19:12 +0100
commit65bdbc1ff23b0a817f4d9a4682e6f630c9bbdd59 (patch)
treec90696bbcaf9455ccd603287584f106a005c0053 /doc/CMakeLists.txt
parentfb75ebbc33557ddd56f505100ad3631a0028eb86 (diff)
downloadbitcoin-65bdbc1ff23b0a817f4d9a4682e6f630c9bbdd59.tar.xz
cmake: Add `docs` build target
Diffstat (limited to 'doc/CMakeLists.txt')
-rw-r--r--doc/CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000000..61a7653e4a
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (c) 2024-present The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
+# file COPYING or https://opensource.org/license/mit/.
+
+find_package(Doxygen COMPONENTS dot)
+
+if(DOXYGEN_FOUND)
+ set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+ configure_file(Doxyfile.in ${doxyfile})
+
+ # In CMake 3.27, The FindDoxygen module's doxygen_add_docs()
+ # command gained a CONFIG_FILE option to specify a custom doxygen
+ # configuration file.
+ # TODO: Consider using it.
+ add_custom_target(docs
+ COMMAND Doxygen::doxygen ${doxyfile}
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ COMMENT "Generating developer documentation"
+ VERBATIM USES_TERMINAL
+ )
+else()
+ add_custom_target(docs
+ COMMAND ${CMAKE_COMMAND} -E echo "Error: Doxygen not found"
+ )
+endif()