-
Notifications
You must be signed in to change notification settings - Fork 3
/
voyx.sh
executable file
·50 lines (37 loc) · 1.25 KB
/
voyx.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
#!/bin/bash
# ###########################################################################
#
# The qt@5 is keg-only, which means it was not symlinked into /opt/homebrew,
# because this is an alternate version of another formula.
#
# If you need to have qt@5 first in your PATH, run:
# echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.zshrc
#
# For compilers to find qt@5 you may need to set:
# export LDFLAGS="-L/opt/homebrew/opt/qt@5/lib"
# export CPPFLAGS="-I/opt/homebrew/opt/qt@5/include"
#
PATH="/opt/homebrew/opt/qt@5/bin:$PATH"
#
# ###########################################################################
SOURCE=$(dirname "$0")
if [[ ${1} == "xcode" ]]; then
OPTIONS="-G Xcode"
BUILD="${SOURCE}/build-xcode"
RUN="${BUILD}/Debug/voyx ${@:2}"
elif [[ ${1} == "debug" ]]; then
OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=Debug"
BUILD="${SOURCE}/build-debug"
RUN="${BUILD}/voyx ${@:2}"
elif [[ ${1} == "release" ]]; then
OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=Release"
BUILD="${SOURCE}/build-release"
RUN="${BUILD}/voyx ${@:2}"
else
OPTIONS="-G Ninja -DCMAKE_BUILD_TYPE=Release"
BUILD="${SOURCE}/build-release"
RUN="${BUILD}/voyx ${@}"
fi
cmake -S ${SOURCE} -B ${BUILD} ${OPTIONS} || exit $?
cmake --build ${BUILD} || exit $?
${RUN}