forked from TING2938/Gmx2020PostAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·48 lines (38 loc) · 927 Bytes
/
configure
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
45
46
47
#!/usr/bin/env bash
if [ $# -lt 1 ] ; then
echo "Error! please specify a source code"
echo "for help, type \"-h\""
echo "usage: ./configure path/to/<sourcecode>.cpp"
exit
fi
if [ $1 = "-h" ]; then
if [ ! -d "./build" ]; then
mkdir ./build
fi
cd build
cmake .. -LH
exit
fi
if [ ! -f $1 ]; then
echo $1
echo "No such file!"
exit
fi
## Specify the code installation path
# export CODE_INSTALL_PATH=~/install/myCode/code
## Specify the C/C++ compiler
# gccPath=/share/apps/gcc-5.1.0
# export CC=$gccPath/bin/gcc
# export CXX=$gccPath/bin/g++
# export LD_LIBRARY_PATH=$gccPath/lib64:$LD_LIBRARY_PATH
# export C_INCLUDE_PATH=$gccPath/include:$C_INCLUDE_PATH
# export CPLUS_INCLUDE_PATH=$gccPath/include:$CXX_INCLUDE_PATH
extension=${1##*.}
export BaseFileName=$(basename $1 .${extension})
export DirName=$(dirname $1)
if [ ! -d "./build" ]; then
mkdir ./build
fi
cd build
cmake .. ${@:2}
make