From 5700bf6b3d8f2c53a459676370a9dd9a69e2ffb9 Mon Sep 17 00:00:00 2001 From: Javier Galan Date: Sun, 14 Jul 2024 10:15:34 +0200 Subject: [PATCH] thisREST.cmake identifying if we are using CVMFS LCG setup --- cmake/thisREST.cmake | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/thisREST.cmake b/cmake/thisREST.cmake index a51c4257d..3613b0e1d 100644 --- a/cmake/thisREST.cmake +++ b/cmake/thisREST.cmake @@ -1,5 +1,17 @@ # Write thisREST.[c]sh to INSTALL directory +##### Checking if we are using CVMFS LCG GCC11 environment +set(lcg_found FALSE) + +# Check if the CMAKE_COMMAND contains both "cvmfs", "lcg" and "x86_64-el9-gcc11" +string(FIND "${CMAKE_COMMAND}" "cvmfs" cvmfs_pos) +string(FIND "${CMAKE_COMMAND}" "lcg" lcg_pos) +string(FIND "${CMAKE_COMMAND}" "x86_64-el9-gcc11" gcc_pos) + +if (lcg_pos GREATER -1 AND cvmfs_pos GREATER -1 AND gcc_pos GREATER -1) + set(lcg_found TRUE) +endif() + # We identify the thisroot.sh script for the corresponding ROOT version execute_process( COMMAND root-config --prefix @@ -28,8 +40,8 @@ if (${REST_G4} MATCHES "ON") endif () set(loadLCG "") -if( ${REST_LCG} MATCHES "ON" ) - set(loadG4 +if( lcg_found ) + set(loadLCG "\# REST_LCG was enabled. We load LCG_104 environment.\nsource /cvmfs/sft.cern.ch/lcg/views/LCG_104/x86_64-el9-gcc11-opt/setup.sh\n\n") endif()