From ecb8ca4ec0cd4eda6c51eef5635e6f2af0f2a183 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 31 Oct 2018 12:26:53 +0000
Subject: [PATCH 1/4] Allow building from released tarball

---
 CMakeLists.txt | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1686161..725c142 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,11 +10,17 @@ include(Findcppcheck)
 include(CppcheckTargets)
 include(ExternalProject)
 
-find_package(Git REQUIRED)
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
+  find_package(Git REQUIRED)
 
-# Information from git
-# ====================
-include(LIEFGit)
+  # Information from git
+  # ====================
+  include(LIEFGit)
+else()
+  set(LIEF_VERSION_MAJOR "0")
+  set(LIEF_VERSION_MINOR "9")
+  set(LIEF_VERSION_PATCH "0")
+endif()
 
 # LIEF Project
 # ============
-- 
2.19.1

