-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·70 lines (59 loc) · 1.4 KB
/
run
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
function show_usage {
echo "usage: "
echo " run [debug] [solid]"
echo "where: "
echo " [debug] is an option for compilation with debug flags "
echo " [solid] build all sources in one *.cpp file "
echo
exit 0
}
debug='no'
solid='OFF'
cmake_build_dir='release'
cmake_build_type='Release'
function check_arg {
if [[ $1 ]]; then
if [[ "$1" == "debug" ]]; then
debug='yes'
cmake_build_dir='debug'
cmake_build_type='Debug'
elif [[ "$1" == "solid" ]]; then
solid='ON'
else
show_usage
fi
fi
}
check_arg $1
check_arg $2
config="
#!/bin/bash \n
\n
# The relative path to the directory, containing binary executables: \n
binpath='../build/${cmake_build_dir}/bin'\n
\n
# The relative path to the directory, containing math sources:\n
mathpath='../math'\n
"
echo -e ${config} > config
echo "---------------------------"
echo " BUILDING THE PROJECT ... "
echo "---------------------------"
if [ ! -d build ]; then
mkdir build
fi
cd build
if [ ! -d $cmake_build_dir ]; then
mkdir $cmake_build_dir
fi
cd $cmake_build_dir
cmake ../.. -DCMAKE_BUILD_TYPE=${cmake_build_type} -DCMAKE_INSTALL_PREFIX=./ -DBUILD_SOLID=${solid}
make -j `nproc` && make install
cd .. && cd ..
echo "-------------------------------"
echo " building the project - DONE "
echo "-------------------------------"
# Test translations of first 100 000 lines from set.mm
cd scripts
./test uset-100000