at 22.05-pre 51 lines 2.2 kB view raw
1diff --git i/cmake/version.cmake w/cmake/version.cmake 2index 0ed123b5..4348e7e1 100644 3--- i/cmake/version.cmake 4+++ w/cmake/version.cmake 5@@ -90,41 +90,12 @@ function(determine_version source_dir var_prefix) 6 else() 7 message(STATUS "Found no version.txt.") 8 endif() 9- # for GIT_EXECUTABLE 10- find_package(Git REQUIRED) 11- # get a description of the version, something like: 12- # v1.9.1-0-g38ffe82 (a tagged release) 13- # v1.9.1-0-g38ffe82-dirty (a tagged release with local modifications) 14- # v1.9.0-3-g5b92266 (post-release snapshot) 15- # v1.9.0-3-g5b92266-dirty (post-release snapshot with local modifications) 16- _git(version describe --abbrev=${GIT_REV_LEN} --match "v[0-9]*" --long --dirty) 17- if (NOT _git_ec EQUAL 0) 18- # no annotated tags, fake one 19- message(STATUS "Found no annotated tags.") 20- _git(revision rev-parse --short=${GIT_REV_LEN} --verify HEAD) 21- if (_git_ec EQUAL 0) 22- set(version "v${base_version}-0-g${revision}") 23- # check if dirty (this won't detect untracked files, but should be ok) 24- _git(changes diff-index --quiet HEAD --) 25- if (NOT _git_ec EQUAL 0) 26- string(APPEND version "-dirty") 27- endif() 28- # append the commit timestamp of the most recent commit (only 29- # in non-release branches -- typically master) 30- _git(commit_timestamp show -s --format=%ct) 31- if (_git_ec EQUAL 0) 32- string(APPEND version "+${commit_timestamp}") 33- endif() 34- elseif(has_version_txt) 35- # Nothing to get from git - so use version.txt completely 36- set(version "${version_file}") 37- else() 38- # Sad case - no git, no version.txt 39- set(version "v${base_version}") 40- endif() 41+ if(has_version_txt) 42+ # Nothing to get from git - so use version.txt completely 43+ set(version "${version_file}") 44 else() 45- set(has_release_tag YES) 46- message(STATUS "Found annotated tag ${version}") 47+ # Sad case - no git, no version.txt 48+ set(version "v${base_version}") 49 endif() 50 extract_version_info("${version}" "${local_prefix}") 51 if ("${has_version_txt}" AND NOT ${base_version} STREQUAL ${local_prefix}_VERSION)