-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuildDependencies.sh
73 lines (59 loc) · 1.49 KB
/
buildDependencies.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
#!/bin/bash
projectPath=$(pwd)
# Default arguments
buildType="Default"
externalDependenciesPath=$projectPath"/ExternalDependencies"
# Process arguments
index=0
for ((i=1; i<=$#; i++ )); do
arg=${!i}
if [ $arg = "-h" ] || [ $arg = "--help" ]; then
echo ""
echo "Build Arguments:"
echo " --all: build all possible dependencies"
echo " --cpu: build dependencies for a CPU build"
echo " --gpu: build dependencies for a GPU build"
echo " --path <folder> : external dependencies path"
echo ""
return
fi
if [ $arg = "--all" ]; then
buildType="all"
fi
if [ $arg = "--cpu" ]; then
buildType="cpu"
fi
if [ $arg = "--gpu" ]; then
buildType="gpu"
fi
if [ $arg = "--path" ]; then
index=i
index=$((index+1))
externalDependenciesPath=${!index}
fi
done
# create folder for dependencies
mkdir $externalDependenciesPath
pushd $externalDependenciesPath
# copy the scripts into that folder and run
cp $projectPath/scripts/thirdparty/*.sh .
if [ $buildType = "all" ]; then
echo "building all possible dependencies ..."
source buildAllExternal.sh
elif [ $buildType = "cpu" ]; then
echo "building all CPU dependencies ..."
source buildCpuExternal.sh
elif [ $buildType = "gpu" ]; then
echo "building all GPU dependencies ..."
source buildGpuExternal.sh
else
echo "building default dependencies ..."
source buildExternal.sh
fi
popd
#
# Build Arguments:
# --all : build all dependencies
# --cpu : build CPU dependencies
# --gpu : build GPU dependencies
# --path : build dependency path