generated from eheperson/rpp-p
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bake.sh
executable file
·82 lines (61 loc) · 2.19 KB
/
bake.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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
rootDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
buildDir="${rootDir}/out/build"
installDir="${rootDir}/out/app"
cmakeCache="${buildDir}/CmakeCache.txt"
# clear cmake cache before configure
if [ -f ${cmakeCache} ]; then
rm ${cmakeCache}
fi
# delete and re-create build directory at every time
if [ ! -d ${buildDir} ]; then
mkdir ${buildDir}
# else
# rm -r ${buildDir}
# mkdir ${buildDir}
fi
# delete and re-create install directory at every time
if [ ! -d ${installDir} ]; then
mkdir ${installDir}
else
rm -r ${installDir}
mkdir ${installDir}
fi
# -----------------------------------
# CONFIGURE
# -----------------------------------
echo "" && echo " Configure Begin" &&echo ""
# alternatives
# cmake -G "MinGW Makefiles" -DUSE_EXAMPLELIB=ON -S ${rootDir} -B ${buildDir}
# cmake -DUSE_ADDER=OFF -S . -B ${buildDir}
cmake -DCMAKE_INSTALL_PREFIX=${installDir} -S ${rootDir} -B ${buildDir}
echo "" && echo " Configure End" && echo ""
# -----------------------------------
# BUILD
# -----------------------------------
echo "" && echo " Build Begin" && echo ""
# alternatives
# cd ${buildDir} && make && cd ${rootDir}
# cd ${buildDir} && mingw32-make && cd ${rootDir}
cd ${buildDir} && cmake --build . -v && cd ${rootDir}
# if cmake version below than 3.13 use below
# cd ${buildDir} && ./configure --prefix=${installDir} && make && cd ${rootDir}
echo "" && echo " Build End" && echo ""
# -----------------------------------
# INSTALL
# -----------------------------------
echo "" && echo " Install Begin" && echo ""
# cd ${buildDir} && cmake --install . --prefix ${installDir} && cd ${rootDir}
# cd ${buildDir} && cmake --install . && cd ${rootDir}
# if cmake version below than 3.13 use below
# cd ${buildDir} && sudo make install && cd ${rootDir}
echo "" && echo " Install End " && echo ""
# -----------------------------------
# PACKING
# -----------------------------------
echo "" && echo " Packing Begin" && echo ""
#
# cd ${buildDir} && cpack -C Debug --verbose cd ${rootDir}
# To create an archive of the full source tree you would type:
# cpack --config CPackSourceConfig.cmake
echo "" && echo " Packing End " && echo ""