From 72670bbf73ad3ea96b0c07411c20a2aba8221680 Mon Sep 17 00:00:00 2001
From: Marco Clemencic <marco.clemencic@cern.ch>
Date: Thu, 6 Apr 2017 23:20:50 +0200
Subject: [PATCH] Updated toolchain.cmake to work with latest LbScripts

---
 toolchain.cmake | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/toolchain.cmake b/toolchain.cmake
index 6d47517..8bcc200 100644
--- a/toolchain.cmake
+++ b/toolchain.cmake
@@ -1,11 +1,16 @@
-# Special wrapper to load the declared version of the heptools toolchain.
-set(heptools_version 79)
+# Set the version of HEPTools to use
+set(heptools_version 84)
+
+# this check is needed because the toolchain is called when checking the
+# compiler (without the proper cache)
+if(NOT CMAKE_SOURCE_DIR MATCHES "CMakeTmp")
+
+  find_file(default_toolchain NAMES GaudiDefaultToolchain.cmake
+            HINTS ${CMAKE_SOURCE_DIR}/cmake)
+  if(default_toolchain)
+    include(${default_toolchain})
+  else()
+    message(FATAL_ERROR "Cannot find GaudiDefaultToolchain.cmake")
+  endif()
 
-find_file(use_heptools_module UseHEPTools.cmake
-          HINTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
-# this check is needed because the toolchain seem to be called a second time
-# without the proper cache
-if(use_heptools_module)
-  include(${use_heptools_module})
-  use_heptools(${heptools_version})
 endif()
-- 
GitLab