From 9568d5bb737eb468e87fd43f21404e2def101e30 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Mon, 12 Aug 2024 19:58:32 +0200 Subject: Display Git revision in docs generated from releases (#499) - makesrcdist: store Git revision in a file in the tarball - CMake/resources.cmake: get git revision either from Git or file and store it as CMake cache variable 'FLTK_GIT_REVISION' for reference - documentation/*: get git revision from git or file - fluid/documentation/*: get git revision from git or file --- fluid/documentation/CMakeLists.txt | 21 --------------------- fluid/documentation/generated.dox.in | 4 ++-- fluid/documentation/src/fluid-title.tex.in | 2 +- 3 files changed, 3 insertions(+), 24 deletions(-) (limited to 'fluid') diff --git a/fluid/documentation/CMakeLists.txt b/fluid/documentation/CMakeLists.txt index fb2fac442..fccdeac97 100644 --- a/fluid/documentation/CMakeLists.txt +++ b/fluid/documentation/CMakeLists.txt @@ -15,7 +15,6 @@ # set(DOCS) -set(GIT_REVISION "") set(YEAR "") set(CURRENT_DATE "") @@ -38,26 +37,6 @@ if(FLTK_BUILD_FLUID_DOCS OR FLTK_BUILD_PDF_DOCS) OUTPUT_STRIP_TRAILING_WHITESPACE ) - # find git revision - - # FIXME: This must also work with tarballs where git is not available. - # For now we just ignore errors and set GIT_REVISION = "unknown". - # In the future tarball/zip generation should create a file - # that contains the git revision. - - execute_process(COMMAND - git rev-parse --short=10 HEAD - OUTPUT_VARIABLE GIT_REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE - WORKING_DIRECTORY ${FLTK_SOURCE_DIR} - ERROR_QUIET - ) - - # set to "'unknown'" if git is not available - if(GIT_REVISION STREQUAL "") - set(GIT_REVISION "'unknown'") - endif() - # Find "short" doxygen version if it was built from Git # Note: this is still needed in CMake 3.12.0 but later CMake versions # (notably 3.25) remove the Git revision in 'DOXYGEN_VERSION'. diff --git a/fluid/documentation/generated.dox.in b/fluid/documentation/generated.dox.in index 9ab6987e0..75f8dfc1e 100644 --- a/fluid/documentation/generated.dox.in +++ b/fluid/documentation/generated.dox.in @@ -1,6 +1,6 @@
Generated on @CURRENT_DATE@ - from Git revision @GIT_REVISION@ - by Doxygen @DOXYGEN_VERSION_SHORT@ + from Git revision '@FLTK_GIT_REVISION@' + by Doxygen version '@DOXYGEN_VERSION_SHORT@' diff --git a/fluid/documentation/src/fluid-title.tex.in b/fluid/documentation/src/fluid-title.tex.in index f0036d417..294d82779 100644 --- a/fluid/documentation/src/fluid-title.tex.in +++ b/fluid/documentation/src/fluid-title.tex.in @@ -27,7 +27,7 @@ provided this copyright and permission notice are preserved.}\\ \vspace*{0.5cm} \today{}\\ \vspace*{0.5cm} -{\small Git revision @GIT_REVISION@}\\ +{\small Git revision '@FLTK_GIT_REVISION@'}\\ \end{center} \end{titlepage} % -- cgit v1.2.3