diff options
author | dec05eba <dec05eba@dec05ebas-iMac.local> | 2018-09-29 22:03:50 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | e7ebd55c31148089eb54ffbd708216c1c7cb09ff (patch) | |
tree | 2a55e1bfe6ce3e2f8ca6c21d8046565abcafd4d9 /cmake | |
parent | 19370a2213efe960e959832145a165d6e2ad6a65 (diff) |
Add support for macos
Diffstat (limited to 'cmake')
-rwxr-xr-x | cmake/install.sh | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/cmake/install.sh b/cmake/install.sh index 384ad5d..595fd26 100755 --- a/cmake/install.sh +++ b/cmake/install.sh @@ -1,12 +1,24 @@ -#!/usr/bin/env bash +#!/bin/sh set -e +case "$(uname -s)" in + Linux*) machine="Linux" ;; + Darwin*) machine="Mac" ;; + *) echo "The install file can only be run on linux and mac" && exit 1 ;; +esac + scriptpath="$(dirname "$0")" mkdir -p "$scriptpath/build/release" cd "$scriptpath/build/release" cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ../../../ ninja -sudo cp sibs /usr/bin/ -echo "Copied $scriptpath/build/release/sibs to /usr/bin/sibs" + +case $machine in + Linux) bin_dir="/usr/bin" ;; + Mac) bin_dir="/usr/local/bin" ;; +esac + +sudo cp sibs "$bin_dir" +echo "Copied $scriptpath/build/release/sibs to $bin_dir/sibs" echo "Installation successful!" |