From: =?utf-8?q?Christian_G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Mon, 4 Jan 2021 14:15:00 +0100
Forwarded: not-needed
Subject: Use release version for Debian

Drop upstream git information from version output.
---
 CMakeLists.txt | 17 -----------------
 VERSION.cmake  |  5 +++++
 2 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5df2388..856893a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,29 +61,12 @@ include(GNUInstallDirs)
 include(DefineInstallationPaths)
 include(GenerateExportHeader)
 
-include(GetGitRevisionDescription)
-
-get_git_head_revision(GIT_REFSPEC GIT_SHA1)
-
 add_definitions(
     -DQT_USE_QSTRINGBUILDER
     -DQT_MESSAGELOGCONTEXT #enable function name and line number in debug output
     -DQT_DEPRECATED_WARNINGS
 )
 
-# if we cannot get it from git, directly try .tag (packages)
-# this will work if the tar balls have been properly created
-# via git-archive.
-if ("${GIT_SHA1}" STREQUAL "GITDIR-NOTFOUND")
-    file(READ ${CMAKE_SOURCE_DIR}/.tag sha1_candidate)
-    string(REPLACE "\n" "" sha1_candidate ${sha1_candidate})
-    if (NOT ${sha1_candidate} STREQUAL "$Format:%H$")
-        message("${sha1_candidate}")
-        set (GIT_SHA1 "${sha1_candidate}")
-    endif()
-endif()
-message(STATUS "GIT_SHA1 ${GIT_SHA1}")
-
 set(SYSCONFDIR ${SYSCONF_INSTALL_DIR})
 set(DATADIR ${DATA_INSTALL_DIR})
 if(WIN32)
diff --git a/VERSION.cmake b/VERSION.cmake
index 6fbc256..079016e 100644
--- a/VERSION.cmake
+++ b/VERSION.cmake
@@ -24,3 +24,8 @@ set( MIRALL_VERSION_STRING "${MIRALL_VERSION}${MIRALL_VERSION_SUFFIX}" )
 if( MIRALL_VERSION_BUILD )
     set( MIRALL_VERSION_STRING "${MIRALL_VERSION_STRING} (build ${MIRALL_VERSION_BUILD})" )
 endif( MIRALL_VERSION_BUILD )
+
+# Version from Debian changelog
+if( EXTERNAL_VERSION )
+    set( MIRALL_VERSION_STRING "${EXTERNAL_VERSION}" )
+endif( EXTERNAL_VERSION )
