forked from agra-uni-bremen/dependencies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·41 lines (34 loc) · 913 Bytes
/
build
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
#!/bin/bash
base_dir=$( cd $(dirname $0) && pwd )
source $base_dir/common.sh
if [ $# -lt 2 ]; then
echo "usage: $0 <target_dir> package {package ...}"
exit 21
fi
root="$(mkdir -p $1 && cd $1 && pwd)"
target="$root"
build="${BUILD_DIR:-$root/build}"
shift;
mkdir -p "$target"
mkdir -p "$build"
packages=$( with_deps $@ )
for p in $packages; do
target="$root/$p"
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$target"
if [ -d "$target" ] ; then
if [ $duplicate = "skip" ]; then
message "skipping $p" &&
continue
elif [ $duplicate = "remove" ]; then
message "removing existing package $p" &&
rm -r "$target"
elif [ $duplicate = "rebuild" ]; then
message "rebuilding existing package $p" &&
run_scripts build_install
continue
else
error "directory for $p already exists"
fi
fi
run_scripts download_unpack pre_build build_install
done