From 3fd3583157a16224117832504efc5e1299fb55a6 Mon Sep 17 00:00:00 2001
From: Florian Uhlig <f.uhlig@gsi.de>
Date: Mon, 26 Feb 2024 12:06:30 +0100
Subject: [PATCH] Fix compilation problem with external package Hal

Fixes the problem also when passing path info as CMake parameters for
FairSoft/FairRoot apr21p2/v18.6.7.

The solution now works for CMake parameters as well as for environment variables
for bost FairSoft/FairRoot combinations apr21p2/v18.6.7 and nov22p1/v18.8.0.
---
 external/Hal.patch | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/external/Hal.patch b/external/Hal.patch
index b9b1213ca7..09dcb8a222 100644
--- a/external/Hal.patch
+++ b/external/Hal.patch
@@ -62,10 +62,10 @@ index 1fad98c..19a3290 100644
  Set(Boost_NO_BOOST_CMAKE TRUE)
  Set(BOOST_ROOT ${SIMPATH})
 diff --git a/cmake/modules/HalMacros.cmake b/cmake/modules/HalMacros.cmake
-index c48a4ca..284a5a9 100644
+index c48a4ca..19e60d0 100644
 --- a/cmake/modules/HalMacros.cmake
 +++ b/cmake/modules/HalMacros.cmake
-@@ -8,15 +8,17 @@ Macro(SetFairBase)
+@@ -8,15 +8,20 @@ Macro(SetFairBase)
        SET(FAIRBASE ${FAIRBASE})
      Else (FAIRBASE)
        Message(STATUS "NOT Found FAIRBASE")
@@ -79,6 +79,9 @@ index c48a4ca..284a5a9 100644
 +      endif()
 +      if(NOT FAIRROOTPATH)
 +        SET(FAIRROOTPATH $ENV{FAIRROOTPATH})
++      endif()
++      if(NOT ENV{FAIRROOTPATH})
++        SET(ENV{FAIRROOTPATH} ${FAIRROOTPATH})
 +      endif()
      EndIf (FAIRBASE)
 -    set(CMAKE_MODULE_PATH "$ENV{FAIRROOTPATH}/share/fairbase/cmake/modules_old" ${CMAKE_MODULE_PATH})
-- 
GitLab