diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-08-12 19:58:32 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2024-08-26 20:02:42 +0200 |
| commit | 9568d5bb737eb468e87fd43f21404e2def101e30 (patch) | |
| tree | 37dccaef760e15fa48d7d49569570ed6f2b3f88a /documentation/CMakeLists.txt | |
| parent | 13f1911624359e8370c070981bb4b391b3caaae1 (diff) | |
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
Diffstat (limited to 'documentation/CMakeLists.txt')
| -rw-r--r-- | documentation/CMakeLists.txt | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/documentation/CMakeLists.txt b/documentation/CMakeLists.txt index cf9699449..150771a0d 100644 --- a/documentation/CMakeLists.txt +++ b/documentation/CMakeLists.txt @@ -1,7 +1,7 @@ # # CMakeLists.txt to build docs for the FLTK project using CMake (www.cmake.org) # -# Copyright 1998-2023 by Bill Spitzak and others. +# Copyright 1998-2024 by Bill Spitzak and others. # # This library is free software. Distribution and use rights are outlined in # the file "COPYING" which should have been included with this file. If this @@ -16,7 +16,6 @@ set(DOCS) set(GENERATE_DOCS FALSE) -set(GIT_REVISION "") set(YEAR "") set(CURRENT_DATE "") @@ -49,28 +48,8 @@ if(GENERATE_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 + # Note: this is still needed in CMake 3.15 but later CMake versions # (notably 3.25) remove the Git revision in 'DOXYGEN_VERSION'. # Todo: Find the "first good" CMake version and remove this redundant # code once we require this as our minimal version and replace the @@ -98,7 +77,7 @@ if(GENERATE_DOCS) if(0) # debug fl_debug_var(YEAR) fl_debug_var(CURRENT_DATE) - fl_debug_var(GIT_REVISION) + fl_debug_var(FLTK_GIT_REVISION) fl_debug_var(DOXYGEN_FOUND) fl_debug_var(DOXYGEN_EXECUTABLE) fl_debug_var(DOXYGEN_VERSION) |
