Skip to content

Commit 5571f5b

Browse files
committed
breathe now auto-calls doxygen
1 parent b2d0a02 commit 5571f5b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

docs/conf.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#
2020
import os
2121
import sys
22+
import subprocess
2223
# sys.path.insert(0, os.path.abspath('.'))
2324

2425

@@ -165,5 +166,23 @@
165166
'Miscellaneous'),
166167
]
167168

169+
def generate_doxygen_xml(app):
170+
build_dir = '_build'
171+
if not os.path.exists(build_dir):
172+
os.mkdir(build_dir)
173+
174+
try:
175+
subprocess.call(['doxygen', '--version'])
176+
retcode = subprocess.call(['doxygen'])
177+
if retcode < 0:
178+
sys.stderr.write("doxygen error code: {}\n".format(-retcode))
179+
except OSError as e:
180+
sys.stderr.write("doxygen execution failed: {}\n".format(e))
181+
182+
183+
def setup(app):
184+
"""Add hook for building doxygen xml when needed"""
185+
app.connect("builder-inited", generate_doxygen_xml)
186+
168187

169188

python_cpp_example/main.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! Add two integers */
1+
/*! Add two integers woo! */
22
int add(int i, int j);
33
/*! Subtract one integer from another */
44
int subtract(int i, int j);

0 commit comments

Comments
 (0)