mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Add the doxygen cmake file to the CMake Project
Make the docs its own target instead of a project. Dont add the new docs target to ALL. Add an option to disable generating the docs. Update doxygen_awesome to v2.4.2. Update README to reflect new changes.
This commit is contained in:
parent
dc427f19ba
commit
f98e0248c4
3 changed files with 65 additions and 53 deletions
|
|
@ -4,6 +4,7 @@ project(0ad VERSION 0.29.0)
|
|||
|
||||
# Available Options
|
||||
option(android "Use non-working Android cross-compiling mode")
|
||||
option(build-docs "Enable building the doxygen documentation(requires Network access)")
|
||||
option(coverage "Enable code coverage data collection (GCC only)")
|
||||
option(gles "Use non-working OpenGL ES 2.0 mode")
|
||||
option(jenkins-tests "Configure CxxTest to use the XmlPrinter runner which produces Jenkins-compatible output")
|
||||
|
|
@ -144,3 +145,8 @@ include(0ad-BuildFlags)
|
|||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
include(SetupWindowsLibs)
|
||||
endif()
|
||||
|
||||
# Add doxygen target
|
||||
if(build-docs)
|
||||
add_subdirectory(${CMAKE_SOURCE_DIR}/docs/doxygen)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
## Building the Doxygen documentation
|
||||
|
||||
To generate the Doxygen documentation: run "cmake -S . -B output && cmake --build output".
|
||||
To generate the Doxygen documentation:
|
||||
|
||||
```console
|
||||
cmake -S 0ad/rootdir -B output && cmake --build output --target docs
|
||||
```
|
||||
|
||||
If you build the documentation with cmake, the output is located in the folder html inside your
|
||||
specified build directory.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
cmake_minimum_required(VERSION 3.18.4...3.28.0)
|
||||
|
||||
project(Pyrogenesis DESCRIPTION "Pyrogenesis, a RTS Engine" LANGUAGES NONE)
|
||||
cmake_minimum_required(VERSION 3.25.1...4.0.0)
|
||||
|
||||
# Check if Doxygen and graphviz are installed.
|
||||
find_package(Doxygen 1.9.1 REQUIRED dot)
|
||||
|
|
@ -9,9 +7,10 @@ if(DOXYGEN_FOUND)
|
|||
|
||||
include(FetchContent)
|
||||
|
||||
message(STATUS "Fetching doxygen_awesome_css")
|
||||
FetchContent_Declare(doxygen_awesome_css
|
||||
GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css
|
||||
GIT_TAG v2.3.3
|
||||
GIT_TAG v2.4.2
|
||||
SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/styling
|
||||
)
|
||||
FetchContent_MakeAvailable(doxygen_awesome_css)
|
||||
|
|
@ -27,6 +26,8 @@ if(DOXYGEN_FOUND)
|
|||
endif()
|
||||
|
||||
# Doxygen Configuration.
|
||||
set(DOXYGEN_PROJECT_NAME "Pyrogenesis")
|
||||
set(DOXYGEN_PROJECT_BRIEF "Pyrogenesis, a RTS Engine")
|
||||
if(CURRENT_BRANCH)
|
||||
set(DOXYGEN_PROJECT_NUMBER ${CURRENT_BRANCH})
|
||||
else()
|
||||
|
|
@ -35,9 +36,9 @@ if(DOXYGEN_FOUND)
|
|||
set(DOXYGEN_PROJECT_LOGO ${CMAKE_CURRENT_SOURCE_DIR}/pyrogenesis.png)
|
||||
set(DOXYGEN_TAB_SIZE 4)
|
||||
set(DOXYGEN_EXCLUDE_PATTERNS */.svn* */tests/test_*)
|
||||
set(DOXYGEN_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../source)
|
||||
set(DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../source)
|
||||
set(DOXYGEN_EXCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../source/tools ${CMAKE_CURRENT_SOURCE_DIR}/../../source/third_party)
|
||||
set(DOXYGEN_INCLUDE_PATH ${CMAKE_SOURCE_DIR}/source)
|
||||
set(DOXYGEN_EXAMPLE_PATH ${CMAKE_SOURCE_DIR}/source)
|
||||
set(DOXYGEN_EXCLUDE ${CMAKE_SOURCE_DIR}/source/tools ${CMAKE_SOURCE_DIR}/source/third_party)
|
||||
set(DOXYGEN_GENERATE_TREEVIEW YES)
|
||||
set(DOXYGEN_HTML_EXTRA_STYLESHEET ${doxygen_awesome_css_SOURCE_DIR}/doxygen-awesome.css ${CMAKE_CURRENT_SOURCE_DIR}/style.css)
|
||||
set(DOXYGEN_JAVADOC_AUTOBRIEF YES)
|
||||
|
|
@ -54,11 +55,12 @@ if(DOXYGEN_FOUND)
|
|||
set(DOXYGEN_EXPAND_AS_DEFINED DEFAULT_COMPONENT_ALLOCATOR DEFAULT_SCRIPT_WRAPPER DEFAULT_INTERFACE_WRAPPER DEFAULT_MESSAGE_IMPL MESSAGE INTERFACE COMPONENT GUISTDTYPE)
|
||||
set(DOXYGEN_WARN_LOGFILE doxygen.log)
|
||||
|
||||
doxygen_add_docs(${CMAKE_PROJECT_NAME}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../source
|
||||
doxygen_add_docs(docs
|
||||
${CMAKE_SOURCE_DIR}/source
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/mainpage.dox
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../../LICENSE.md
|
||||
ALL)
|
||||
${CMAKE_SOURCE_DIR}/LICENSE.md
|
||||
COMMENT "Creating Doxygen for the engine."
|
||||
)
|
||||
else()
|
||||
message(SEND_ERROR "Make sure Doxygen is installed and usable")
|
||||
endif()
|
||||
|
|
|
|||
Loading…
Reference in a new issue