![]() |
|
|||
File indexing completed on 2025-07-09 07:53:31
0001 #!/bin/sh 0002 # 0003 # This script was automatically generated from the src/scripts/eicrecon-this.sh.in file in the 0004 # EICrecon source directory when EICrecon was built. It can be sourced to set the environment 0005 # up to use this EICrecon build. 0006 # 0007 # This finds directories relative to this script. This should allow the entire EICrecon directory 0008 # to be moved and this script should still work. 0009 # 0010 # Dependency packages (i.e. JANA2 and ROOT) are setup using absolute paths 0011 0012 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 0013 export EICrecon_ROOT=$( readlink -f ${SCRIPT_DIR}/.. ) 0014 0015 # A helper function to prepend paths without duplication, 0016 # allowing for empty and undefined values (but not checking existence), 0017 # but not escaping colons in your paths. 0018 pathadd() { 0019 local varname="$1" 0020 local newpath="$2" 0021 0022 eval "oldvalue=\${${varname}:-}" 0023 0024 # surround with colon so also first and last entry are individually surrounded 0025 local canonical=":${oldvalue}:" 0026 # check whether removing newpath changes old path 0027 if [ "${canonical#*:${newpath}:}" = "${canonical}" ]; 0028 then 0029 # newpath not in old path 0030 if [ -n "${oldvalue}" ]; then 0031 eval "export $varname=${newpath}:${oldvalue}" 0032 else 0033 eval "export $varname=${newpath}" 0034 fi 0035 else 0036 # newpath not in old path 0037 # redefine as what's before newpath plus what's after newpath 0038 canonical=${canonical%%:${newpath}:*}:${canonical##*:${newpath}:} 0039 # substring without surrounding colons 0040 canonical=$(expr substr ${canonical} 2 $(expr ${#canonical} - 2)) 0041 # prepend newpath 0042 eval "export $varname=${newpath}:${canonical}" 0043 fi 0044 } 0045 0046 # Add bin to PATH if not already there 0047 pathadd PATH ${SCRIPT_DIR} 0048 0049 # Add lib to LD_LIBRARY_PATH if not already there 0050 LIB_DIR=$( readlink -f ${EICrecon_ROOT}/lib ) 0051 pathadd LD_LIBRARY_PATH ${LIB_DIR} 0052 0053 # Add plugins to JANA_PLUGIN_PATH if not already there 0054 PLUGINS_DIR=$( readlink -f ${EICrecon_ROOT}/@PLUGIN_OUTPUT_DIRECTORY@ ) 0055 pathadd JANA_PLUGIN_PATH ${PLUGINS_DIR} 0056 0057 # Add plugin headers to ROOT_INCLUDE_PATH if not already there 0058 HEADERS_DIR=$( readlink -f ${EICrecon_ROOT}/include ) 0059 pathadd ROOT_INCLUDE_PATH ${HEADERS_DIR}
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |