Skip to content

Commit a7dda2d

Browse files
committed
Fix some Doxygen stuff
1 parent dbc29e0 commit a7dda2d

File tree

9 files changed

+68
-2328
lines changed

9 files changed

+68
-2328
lines changed

CMakeLists.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,52 @@ if(BUILD_EXAMPLES)
3636
set_property(TARGET cppspec_sample PROPERTY CXX_INCLUDE_WHAT_YOU_USE ${iwyu_path})
3737
endif()
3838
endif(BUILD_EXAMPLES)
39+
40+
41+
# ##### Documentation generation #######
42+
# check if Doxygen is installed
43+
find_package(Doxygen
44+
OPTIONAL_COMPONENTS dot mscgen dia
45+
)
46+
47+
if(DOXYGEN_FOUND)
48+
if(NOT ${DOXYGEN_HAVE_DOT})
49+
message(
50+
"Can't find GraphViz DOT tool for generating images."
51+
"Make sure it's on your PATH or install GraphViz")
52+
endif()
53+
54+
cmake_policy(SET CMP0135 NEW)
55+
56+
include(FetchContent)
57+
58+
FetchContent_Declare(doxygen-awesome-css
59+
URL https://github.com/jothepro/doxygen-awesome-css/archive/refs/tags/v2.2.1.tar.gz
60+
URL_HASH MD5=340d3a206794ac01a91791c2a513991f
61+
)
62+
FetchContent_MakeAvailable(doxygen-awesome-css)
63+
64+
set(DOXYGEN_PROJECT_NAME "C++Spec")
65+
set(DOXYGEN_PROJECT_BRIEF "BDD testing for C++")
66+
set(DOXYGEN_RECURSIVE YES)
67+
set(DOXYGEN_EXAMPLE_RECURSIVE YES)
68+
69+
set(DOXYGEN_NUM_PROC_THREADS ${HOST_NUM_CORES})
70+
71+
# From doxygen-awesome
72+
set(DOXYGEN_GENERATE_TREEVIEW YES)
73+
set(DOXYGEN_DISABLE_INDEX NO)
74+
set(DOXYGEN_FULL_SIDEBAR NO)
75+
set(DOXYGEN_HTML_COLORSTYLE LIGHT)
76+
set(DOXYGEN_HTML_EXTRA_STYLESHEET "${doxygen-awesome-css_SOURCE_DIR}/doxygen-awesome.css")
77+
78+
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE README.md)
79+
80+
file(GLOB markdown_SOURCES *.md)
81+
82+
doxygen_add_docs(doxygen ${markdown_SOURCES} include)
83+
else(DOXYGEN_FOUND)
84+
message(WARNING
85+
"Doxygen needs to be installed to generate documentation."
86+
"Please install from https://github.com/doxygen/doxygen/releases")
87+
endif(DOXYGEN_FOUND)

0 commit comments

Comments
 (0)