From 21211e5645fe399fb32c79bfe3b26a9959594446 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com>
Date: Thu, 5 Apr 2018 00:03:25 +0200
Subject: [PATCH] - Removed cmake-modules dependencies - Added a tarball
 source-tree warning on compile

---
 cmake/GetPastisGitRevision.cmake | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/cmake/GetPastisGitRevision.cmake b/cmake/GetPastisGitRevision.cmake
index 39396dca1..fa4bcf61a 100644
--- a/cmake/GetPastisGitRevision.cmake
+++ b/cmake/GetPastisGitRevision.cmake
@@ -1,8 +1,5 @@
 # --------------- get git revision info ---------------
 
-list(APPEND CMAKE_MODULE_PATH "${PASTIS_SOURCE_DIR}/cmake/cmake-modules")
-include(GetGitRevisionDescription)
-
 set(HAS_PASTIS_GIT_INFO "TRUE")
 
 find_package(Git QUIET)
@@ -50,10 +47,17 @@ endif()
 
 string(FIND "${PASTIS_GIT_TAG}" "${CMAKE_PASTIS_VERSION}" FOUND_VERSION_SUBSTR)
 
-if("${FOUND_VERSION_SUBSTR}" STREQUAL "-1")
+if(FOUND_PASTIS_GIT_INFO EQUAL 0)
+  if("${FOUND_VERSION_SUBSTR}" STREQUAL "-1")
+    message("")
+    message ("######  CMake code version  ${CMAKE_PASTIS_VERSION} and")
+    message ("######  git revision info  ${PASTIS_GIT_TAG} do not match!")
+    message("")
+  endif()
+else()
   message("")
-  message ("######  CMake code version  ${CMAKE_PASTIS_VERSION} and")
-  message ("######  git revision info  ${PASTIS_GIT_TAG} do not match!")
+  message ("######  This source tree is not a git repository!")
+  message ("######  If you intend to change sources consider to clone a git repository!")
   message("")
 endif()
 
-- 
GitLab