Added a few files to fix the build system.
[gromacs/rigid-bodies.git] / scripts / GMXRC.zsh.cmakein
blobaf52294e6f53acfc201788125778be205f0f9142
1 # zsh configuration file for Gromacs
2 # First we remove old gromacs stuff from the paths
3 # by selecting everything else.
4 # This is not 100% necessary, but very useful when we
5 # repeatedly switch between gmx versions in a shell.
7 # ATTENTION
8 # zsh understands sh syntax - so this is just a copy from GMXRC.bash.in
9 # BEGIN COPY
11 # First remove gromacs part of ld_library_path
12 tmppath=""
13 for i in `echo $LD_LIBRARY_PATH | sed "s/:/ /g"`; do
14   if test "$i" != "$GMXLDLIB"; then
15     tmppath="${tmppath}${tmppath:+:}${i}"
16   fi
17 done
18 LD_LIBRARY_PATH=$tmppath
20 # remove gromacs part of PKG_CONFIG_PATH
21 tmppath=""
22 for i in `echo $PKG_CONFIG_PATH | sed "s/:/ /g"`; do
23   if test "$i" != "$GMXLDLIB/pkgconfig"; then
24     tmppath="${tmppath}${tmppath:+:}${i}"
25   fi
26 done
27 PKG_CONFIG_PATH=$tmppath
29 # remove gromacs part of path
30 tmppath=""
31 for i in `echo $PATH | sed "s/:/ /g"`; do
32   if test "$i" != "$GMXBIN"; then
33     tmppath="${tmppath}${tmppath:+:}${i}"
34   fi
35 done
36 PATH=$tmppath
38 # and remove the gmx part of manpath
39 tmppath=""
40 for i in `echo $MANPATH | sed "s/:/ /g"`; do
41   if test "$i" != "$GMXMAN"; then
42     tmppath="${tmppath}${tmppath:+:}${i}"
43   fi
44 done
45 MANPATH=$tmppath
47 ##########################################################
48 # This is the real configuration part. We save the Gromacs
49 # things in separate vars, so we can remove them later.
50 # If you move gromacs, change the next four line.
51 ##########################################################
52 GMXBIN=@BIN_INSTALL_DIR@
53 GMXLDLIB=@LIB_INSTALL_DIR@
54 GMXMAN=@MAN_INSTALL_DIR@
55 GMXDATA=@DATA_INSTALL_DIR@
56         
57 LD_LIBRARY_PATH=${GMXLDLIB}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}
58 PKG_CONFIG_PATH=${GMXLDLIB}/pkgconfig${PKG_CONFIG_PATH:+:}${PKG_CONFIG_PATH}
59 PATH=${GMXBIN}${PATH:+:}${PATH}
60 #debian/ubuntu needs a : at the end
61 MANPATH=${GMXMAN}:${MANPATH}
63 # export should be separate, so /bin/sh understands it
64 export GMXBIN GMXLDLIB GMXMAN GMXDATA LD_LIBRARY_PATH PATH MANPATH PKG_CONFIG_PATH
66 # END COPY
68 # read zsh completions if understand how to use them
69 if compctl >& /dev/null; then
70   if [ -f $GMXBIN/completion.zsh ]; then
71     source $GMXBIN/completion.zsh; 
72   fi