forked from soarqin/finalhe
-
Notifications
You must be signed in to change notification settings - Fork 2
/
macOSBuildScript.sh
executable file
·70 lines (61 loc) · 1.42 KB
/
macOSBuildScript.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
#!/bin/bash
if ! command -v brew &> /dev/null
then
read -p "Brew is not installed. Would you like to install it (y/n)?" answer
case ${answer:0:1} in
y|Y )
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
;;
* )
echo "Brew must be installed to continue. Exiting."
exit 0
;;
esac
fi
if brew list cmake &>/dev/null; then
echo "cmake is installed"
else
echo "Installing cmake..."
brew install cmake
fi
if brew list libusb &>/dev/null; then
echo "libusb is installed"
else
echo "Installing libusb..."
brew install libusb
fi
if brew list pkg-config &>/dev/null; then
echo "pkg-config is installed"
else
echo "Installing pkg-config..."
brew install pkg-config
fi
if brew list qt5 &>/dev/null; then
echo "qt5 is installed"
else
echo "Installing qt5..."
brew install qt5
fi
echo "Checking for qt5 in path..."
if echo $PATH | grep -F "qt@5" &>/dev/null; then
echo "qt5 is in the PATH"
else
echo "Adding qt to path"
echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.profile
source ~/.profile
fi
echo "All dependencies have been installed."
echo "Building FinalHE..."
cmake .
make
echo "Done."
read -p "Would you like to run FinalHE (y/n)? " answer
case ${answer:0:1} in
y|Y )
$(pwd)/src/./FinalHE
;;
* )
exit 0
;;
esac
exit 0