Skip to content

Commit 843c8de

Browse files
committed
Scripts: Introduction of build scripts.
Bash scripts have been introduced for unifying the build process across multiple workstations.
1 parent f558d65 commit 843c8de

File tree

4 files changed

+69
-1
lines changed

4 files changed

+69
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
Build

Scripts/Build.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
pushd "$(dirname "${BASH_SOURCE[0]}")"
4+
5+
source Defines.sh
6+
7+
if [[ -z $OctaneGUI_DIR ]] ; then
8+
echo "OctaneGUI_DIR environment variable not defined! Please provide a path to the OctaneGUI installation through the OctaneGUI_DIR variable!"
9+
exit 1;
10+
fi
11+
12+
CMAKE_OPTIONS="-S $SOURCE_PATH -B $BUILD_PATH -DCMAKE_BUILD_TYPE=$CONFIGURATION -DTOOLS=$TOOLS -DWINDOWING=SDL2"
13+
CMAKE_OPTIONS="$CMAKE_OPTIONS -DOctaneGUI_DIR=$OctaneGUI_DIR -DSDL2_DIR=$SDL2_DIR -DCMAKE_MODULE_PATH=$SDL2_DIR/cmake"
14+
15+
if [[ ! -z $GENERATOR ]] ; then
16+
CMAKE_OPTIONS="-G $GENERATOR $CMAKE_OPTIONS"
17+
fi
18+
19+
echo CMAKE_OPTIONS: $CMAKE_OPTIONS
20+
cmake $CMAKE_OPTIONS
21+
22+
if [ "$NINJA" = true ] ; then
23+
NINJA_VERSION=$(ninja --version)
24+
echo "Using ninja version $NINJA_VERSION"
25+
ninja -C $BUILD_PATH
26+
elif [ "$XCODE" = true ] ; then
27+
xcodebuild -configuration $CONFIGURATION -scheme ALL_BUILD -project "$BUILD_PATH/OctaneGUI.xcodeproj"
28+
else
29+
make -C $BUILD_PATH
30+
fi
31+
32+
popd

Scripts/Clean.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
pushd "$(dirname "${BASH_SOURCE[0]}")"
4+
5+
if [[ -z $BUILD_PATH ]] ; then
6+
source Defines.sh
7+
fi
8+
9+
if [[ -d "$BUILD_PATH" ]] ; then
10+
echo "Cleaning $BUILD_PATH"
11+
rm -rf $BUILD_PATH
12+
fi
13+
14+
popd

Scripts/Defines.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
BUILD_PATH=../Build
4+
SOURCE_PATH=..
5+
6+
CONFIGURATION=Debug
7+
GENERATOR=
8+
TOOLS=OFF
9+
NINJA=false
10+
XCODE=false
11+
12+
for Var in "$@"
13+
do
14+
Var=$(echo $Var | tr '[:upper:]' '[:lower:]')
15+
case ${Var} in
16+
ninja) GENERATOR=Ninja NINJA=true ;;
17+
release) CONFIGURATION=Release ;;
18+
tools) TOOLS=ON ;;
19+
xcode) XCODE=true ;;
20+
*) break
21+
esac
22+
done

0 commit comments

Comments
 (0)