From e7ebd55c31148089eb54ffbd708216c1c7cb09ff Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 29 Sep 2018 22:03:50 +0200 Subject: Add support for macos --- cmake/install.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'cmake') 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!" -- cgit v1.2.3