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()