-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgenerate_doxygen.sh
More file actions
executable file
·83 lines (56 loc) · 1.79 KB
/
Copy pathgenerate_doxygen.sh
File metadata and controls
executable file
·83 lines (56 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#! /bin/bash
#############################################################################
# File: generate_doxygen.sh
#
# Purpose: Generates HTML API documentation from public headers via Doxygen
#
#############################################################################
ScriptPath=$0
Dir=$(cd "$(dirname "$ScriptPath")" && pwd)
Basename=$(basename "$ScriptPath")
CMakeDir=${SIS_CMAKE_BUILD_DIR:-$Dir/_build}
ProjectNameFile="$Dir/.sis/project_name.txt"
ProjectName=$(tr -d '[:space:]' < "$ProjectNameFile")
# ##########################################################
# command-line handling
while [[ $# -gt 0 ]]; do
case $1 in
--help)
[ -f "$Dir/.sis/script_info_lines.txt" ] && cat "$Dir/.sis/script_info_lines.txt"
cat << EOF
Generates HTML API documentation from public headers via Doxygen
$ScriptPath [ ... flags/options ... ]
Flags/options:
standard flags:
--help
displays this help and terminates
Environment:
SIS_CMAKE_BUILD_DIR
CMake build directory (default: <project>/_build); documentation is
written to <build-dir>/doxygen/html/
EOF
exit 0
;;
*)
>&2 echo "$ScriptPath: unrecognised argument '$1'; use --help for usage"
exit 1
;;
esac
shift
done
# ##########################################################
# main()
cd "$Dir" || exit 1
if ! command -v doxygen >/dev/null 2>&1; then
>&2 echo "$ScriptPath: doxygen not found on PATH"
exit 1
fi
mkdir -p "${CMakeDir}/doxygen"
{
cat Doxyfile
echo ""
echo "# Output directory (overridden by ${Basename})"
echo "OUTPUT_DIRECTORY = ${CMakeDir}/doxygen"
} | doxygen -
echo "${ProjectName} API documentation written to ${CMakeDir}/doxygen/html/index.html"
# ############################## end of file ############################# #