diff options
author | Yuri Victorovich <yuri@FreeBSD.org> | 2023-09-04 19:49:18 +0300 |
---|---|---|
committer | Yuri Victorovich <yuri@FreeBSD.org> | 2023-09-04 19:49:18 +0300 |
commit | 3d2d9f191e16f1d8fdcd1124d8bb2f72b116b7cd (patch) | |
tree | f773da67203fbe7f3073601205f9edb5c0b26a2d /CMakeLists.txt | |
parent | f3925148d2febe7a3b6ade60f7dded2df122af60 (diff) |
Allow user to set REMMINA_GIT_REVISION
git_get_exact_tag returns a bogus tag when the directory isn't a
git repository.
This patch allows the user to set revision during build.
It also fixes the bug tha "n/a" comparison was wrong - it was reversed.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e85e73672..44e205826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,10 +300,12 @@ set(WITH_LIBRARY_VERSIONING "ON") message(STATUS "Remmina version: ${Remmina_VERSION}") -include(GetGitRevisionDescription) -git_get_exact_tag(REMMINA_GIT_REVISION --tags --always) -if(${REMMINA_GIT_REVISION} STREQUAL "n/a") - git_rev_parse(REMMINA_GIT_REVISION --short) +if (NOT DEFINED REMMINA_GIT_REVISION) + include(GetGitRevisionDescription) + git_get_exact_tag(REMMINA_GIT_REVISION --tags --always) + if(NOT ${REMMINA_GIT_REVISION} STREQUAL "n/a") + git_rev_parse(REMMINA_GIT_REVISION --short) + endif() endif() message(STATUS "Git Revision: ${REMMINA_GIT_REVISION}") |