-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
44 lines (41 loc) · 1.2 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
DIR_TOP=$(dirname $(readlink -f $BASH_SOURCE))
DIR_BUILD=$DIR_TOP/build
DIR_INST=$DIR_TOP/inst
if [ -e /exp/seaquest/app/software/osg/software/e1039/this-e1039.sh ] ; then
source /exp/seaquest/app/software/osg/software/e1039/this-e1039.sh
elif [ -e /data2/e1039/this-e1039.sh ] ; then
source /data2/e1039/this-e1039.sh
else
echo "Cannot find this-e1039.sh. Abort."
return
fi
export LD_LIBRARY_PATH=$DIR_INST/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=$DIR_INST/include:$ROOT_INCLUDE_PATH
function cmake-this {
if [ -e $DIR_BUILD ] ; then
echo "Clean up the build directory..."
\rm -rf $DIR_BUILD
fi
if [ -e $DIR_INST ] ; then
echo "Clean up the install directory..."
\rm -rf $DIR_INST
fi
mkdir -p $DIR_BUILD
echo "Run cmake..."
( cd $DIR_BUILD && cmake -DCMAKE_INSTALL_PREFIX=$DIR_INST $DIR_TOP/src )
local RET=$?
if [ $RET -eq 0 ] ; then
echo "OK. Run 'make-this' at any time/directory."
else
echo "NG. Need a fix."
fi
return $RET
}
function make-this {
if [ ! -e $DIR_BUILD/Makefile ] ; then
echo "The build directory is not ready. Complete 'cmake-this' first."
return 1
fi
( cd $DIR_BUILD && make install )
return $?
}