aboutsummaryrefslogtreecommitdiff
path: root/cmake/install.sh
blob: 03eae77291c7cbc51050f97add9c740a16bfeb33 (plain)
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
#!/bin/sh

set -e

case "$(uname -s)" in
	Linux*)		machine="Linux" ;;
	Darwin*)	machine="Mac" ;;
	OpenBSD*)	machine="OpenBSD" ;;
	*)		echo "The install file can only be run on linux, mac and openbsd" && exit 1 ;;
esac

scriptpath="$(dirname "$0")"
mkdir -p "$scriptpath/build/release"
cd "$scriptpath/build/release"
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../../../
ninja

case $machine in
	Linux) 		bin_dir="/usr/bin" ;;
	Mac)		bin_dir="/usr/local/bin" ;;
	OpenBSD)	bin_dir="/usr/local/bin" ;;
esac

sudo cp sibs "$bin_dir"
echo "Copied $scriptpath/build/release/sibs to $bin_dir/sibs"
echo "Installation successful!"