forked from Revolutionary-Games/Thrive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·71 lines (56 loc) · 2.19 KB
/
setup.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
71
#!/bin/bash
. utils.sh
################################################################################
# Constants
################################################################################
# The script's directory
DIR=`getScriptDirectory`
# The toolchain template
TOOLCHAIN_TEMPLATE="$DIR/toolchain_linux.cmake.in"
# The default root directory of the mingw environment
DEFAULT_MINGW_ENV="/opt/mingw"
################################################################################
# Usage
################################################################################
USAGE="Usage: $(basename $0) [MINGW_ENV]
MINGW_ENV is the directory to install mingw to and defaults to
$DEFAULT_MINGW_ENV
"
################################################################################
# Parse arguments
################################################################################
if [ $# -eq 0 ]; then
MINGW_ENV=$DEFAULT_MINGW_ENV
elif [ $# -eq 1 ]; then
MINGW_ENV=$1
elif [ $# -gt 1 ]; then
echo $USAGE
exit 1
fi
################################################################################
# Make paths absolute
################################################################################
make_absolute MINGW_ENV
################################################################################
# Prepare directories
################################################################################
mkdir -p $MINGW_ENV
mkdir -p $MINGW_ENV/install
mkdir -p $MINGW_ENV/cmake
################################################################################
# Configure CMake toolchain file
################################################################################
cmake -DTOOLCHAIN_TEMPLATE=$TOOLCHAIN_TEMPLATE -DMINGW_ENV=$MINGW_ENV -P $DIR/configure_toolchain.cmake
################################################################################
# Install libraries
################################################################################
LIBRARIES=('mingw' 'boost' 'ogre_dependencies' 'ogre' 'bullet' 'OpenAL')
# Not used anymore
#'irrKlang')
for LIBRARY in ${LIBRARIES[@]}
do
$DIR/$LIBRARY/install.sh $MINGW_ENV
if [ $? -ne 0 ]; then
exit 1
fi
done