mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-24 18:23:26 -03:00
cmake: Add docs
build target
This commit is contained in:
parent
fb75ebbc33
commit
65bdbc1ff2
4 changed files with 30 additions and 4 deletions
|
@ -578,6 +578,7 @@ endif()
|
||||||
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
||||||
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
|
add_subdirectory(doc)
|
||||||
|
|
||||||
include(cmake/crc32c.cmake)
|
include(cmake/crc32c.cmake)
|
||||||
include(cmake/leveldb.cmake)
|
include(cmake/leveldb.cmake)
|
||||||
|
|
25
doc/CMakeLists.txt
Normal file
25
doc/CMakeLists.txt
Normal file
|
@ -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()
|
|
@ -58,7 +58,7 @@ PROJECT_LOGO = doc/bitcoin_logo_doxygen.png
|
||||||
# entered, it will be relative to the location where doxygen was started. If
|
# entered, it will be relative to the location where doxygen was started. If
|
||||||
# left blank the current directory will be used.
|
# left blank the current directory will be used.
|
||||||
|
|
||||||
OUTPUT_DIRECTORY = doc/doxygen
|
OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doc/doxygen
|
||||||
|
|
||||||
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
|
||||||
# directories (in 2 levels) under the output directory of each output format and
|
# directories (in 2 levels) under the output directory of each output format and
|
||||||
|
|
|
@ -338,11 +338,11 @@ Recommendations:
|
||||||
|
|
||||||
### Generating Documentation
|
### Generating Documentation
|
||||||
|
|
||||||
The documentation can be generated with `make docs` and cleaned up with `make
|
The documentation can be generated with `cmake --build <build_dir> --target docs`.
|
||||||
clean-docs`. The resulting files are located in `doc/doxygen/html`; open
|
The resulting files are located in `<build_dir>/doc/doxygen/html`; open
|
||||||
`index.html` in that directory to view the homepage.
|
`index.html` in that directory to view the homepage.
|
||||||
|
|
||||||
Before running `make docs`, you'll need to install these dependencies:
|
Before building the `docs` target, you'll need to install these dependencies:
|
||||||
|
|
||||||
Linux: `sudo apt install doxygen graphviz`
|
Linux: `sudo apt install doxygen graphviz`
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue