From 95aceb3ccd9b7d50f87ea5e05b64d76fc2d68ab5 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Tue, 13 Aug 2024 19:46:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=E2=99=80=EF=B8=8F=20Fix?= =?UTF-8?q?=20up=20release=20version=20and=20similar=20for=20documentation?= =?UTF-8?q?=20generator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- documentation/CMakeLists.txt | 2 +- documentation/source/conf.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index fc86444..451b857 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -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} diff --git a/documentation/source/conf.py b/documentation/source/conf.py index 570787c..6929aef 100644 --- a/documentation/source/conf.py +++ b/documentation/source/conf.py @@ -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 --------------------------------------------------- @@ -88,7 +90,7 @@ # Breathe Configuration # breathe_projects = {} -breathe_default_project = "ztd_text" +breathe_default_project = "ztd.text" # autosectionlabel Configuration # @@ -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( @@ -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):