From a446916d175e184a47628f49c227d5cbf961e2f1 Mon Sep 17 00:00:00 2001
From: Pere Mato <pere.mato@cern.ch>
Date: Wed, 4 Jun 2014 14:58:22 +0200
Subject: [PATCH] Improve the update of roottest clone

---
 CMakeLists.txt | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 571df184095..001bc6b2a96 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,21 +123,17 @@ endif()
 if(testing)
   include(RootCTest)
   if(roottest)
+    find_package(Git REQUIRED)
     if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/roottest)
       execute_process(COMMAND ${GIT_EXECUTABLE} pull WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/roottest)
       add_subdirectory(roottest)
     elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../roottest)
       add_subdirectory(../roottest roottest)
     else()
-      find_package(Git)
-      if(NOT GIT_EXECUTABLE)
-        message(FATAL_ERROR "-- Could not find git needed to clone roottest directory!")
-      else()
-        message("-- Could not find roottest directory! Cloning from the repository...")
-        execute_process(COMMAND ${GIT_EXECUTABLE} clone http://root.cern.ch/git/roottest.git
-                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-        add_subdirectory(roottest)
-      endif()
+      message("-- Could not find roottest directory! Cloning from the repository...")
+      execute_process(COMMAND ${GIT_EXECUTABLE} clone http://root.cern.ch/git/roottest.git
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+      add_subdirectory(roottest)
     endif()
   endif()
 endif()
-- 
GitLab