forked from LukasBanana/LLGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildMacOS.sh
executable file
·38 lines (30 loc) · 883 Bytes
/
BuildMacOS.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
#!/bin/sh
SOURCE_DIR=$PWD
OUTPUT_DIR="build"
# Ensure we are inside the repository folder
if [ ! -f "CMakeLists.txt" ]; then
echo "error: file not found: CMakeLists.txt"
exit 1
fi
# Make output build folder
if [ "$#" -eq 1 ]; then
OUTPUT_DIR=$1
else
if [ ! "$#" -eq 0 ]; then
echo "error: too many arguemnts"
echo "usage: BuildMacOS.sh [OUTPUT_DIR]"
exit 1
fi
fi
if [ ! -d "$OUTPUT_DIR" ]; then
mkdir "$OUTPUT_DIR"
fi
cd "$OUTPUT_DIR"
# Checkout external depenencies
GAUSSIAN_LIB_DIR="$OUTPUT_DIR/GaussianLib/include"
if [ ! -d "$GAUSSIAN_LIB_DIR" ]; then
git clone https://github.com/LukasBanana/GaussianLib.git
fi
# Build into output directory
cmake -DLLGL_BUILD_RENDERER_OPENGL=ON -DLLGL_BUILD_RENDERER_METAL=ON -DLLGL_BUILD_EXAMPLES=ON -DGaussLib_INCLUDE_DIR:STRING="$GAUSSIAN_LIB_DIR" -S "$SOURCE_DIR"
cmake --build .