Skip to content

Commit

Permalink
👷‍♀️ Fix up release version and similar for documentation generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Aug 13, 2024
1 parent dd646c8 commit 95aceb3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion documentation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if (NOT ZTD_TEXT_DOCUMENTATION_NO_SPHINX)
COMMAND Sphinx::Build
ARGS
-b html
-Dbreathe_projects.ztd_text=${ZTD_TEXT_DOXYGEN_XML_OUTPUT_DIR}
-Dbreathe_projects.ztd.text=${ZTD_TEXT_DOXYGEN_XML_OUTPUT_DIR}
${ZTD_TEXT_SPHINX_SOURCE_DIR}
${ZTD_TEXT_SPHINX_BUILD_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
Expand Down
18 changes: 12 additions & 6 deletions documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@

# The full version, including alpha/beta/rc tags
#
release = '0.0.0'
# get it from git
release_label = str(subprocess.check_output(["git", "describe", "--always"]).strip())
release = release_label if release_label else '0.0.0'

# -- General configuration ---------------------------------------------------

Expand Down Expand Up @@ -88,7 +90,7 @@
# Breathe Configuration
#
breathe_projects = {}
breathe_default_project = "ztd_text"
breathe_default_project = "ztd.text"

# autosectionlabel Configuration
#
Expand All @@ -106,8 +108,8 @@ def run_cmake_doxygen():
xml_dir = os.path.join(cmake_dir, 'documentation/doxygen/xml')
os.makedirs(cmake_dir, exist_ok=True)
os.makedirs(xml_dir, exist_ok=True)
print("[ztd_text/documentation/conf.py] CMake Directory: %s" % cmake_dir)
print("[ztd_text/documentation/conf.py] XML Directory: %s" % xml_dir)
print("[ztd.text/documentation/conf.py] CMake Directory: %s" % cmake_dir)
print("[ztd.text/documentation/conf.py] XML Directory: %s" % xml_dir)

try:
retcode = subprocess.call(
Expand All @@ -120,14 +122,18 @@ def run_cmake_doxygen():

try:
retcode = subprocess.call(
"cmake --build . --target \"ztd_text.documentation.doxygen\"",
"cmake --build . --target \"ztd.text.documentation.doxygen\"",
shell=True,
cwd=cmake_dir)
if retcode != 0:
sys.stderr.write("cmake generaction execution failed with error code: %d\n" % retcode)
else:
sys.stdout.write("cmake generaction execution succeeded")
except OSError as e:
sys.stderr.write("cmake generation execution failed: %s\n" % e)
return

breathe_projects["ztd_text"] = xml_dir
breathe_projects["ztd.text"] = xml_dir


def generate_doxygen_xml(app):
Expand Down

0 comments on commit 95aceb3

Please sign in to comment.