-
Notifications
You must be signed in to change notification settings - Fork 43
/
build.sh
executable file
·75 lines (61 loc) · 1.98 KB
/
build.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
72
73
74
#!/bin/bash
#
#
echo <<EOD
Build script for radar_pi
-------------------------
This script is intended for use by @canboat, @hakansv and @douwefokkema only.
We use it to set preconditions on our build machines to run in IDE.
Any others: use at own risk.
Feel free to adapt this to your own situation.
EOD
set -e -u # Fail on first error
BUILD_TYPE="${1:-cli}"
BUILDDIR="rel-`uname`-`uname -m`"
STATE="Unofficial"
TARGET="tarball"
CMAKE_OPTIONS=""
MAKE_OPTIONS=""
host=$(hostname)
echo "Adapting to $host-$BUILD_TYPE"
case $host-$BUILD_TYPE in
kees-m*cli)
BUILDDIR=rel-mac
WX="${HOME}/src/wx315_opencpn50_macos1010"
CMAKE_OPTIONS=" -DwxWidgets_CONFIG_EXECUTABLE=${WX}/bin/wx-config
-DwxWidgets_CONFIG_OPTIONS='--prefix=${WX}'
-DCMAKE_INSTALL_PREFIX=
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10
-DCMAKE_OSX_ARCHITECTURES=x86_64
"
export CMAKE_BUILD_PARALLEL_LEVEL=8
;;
kees-m*ide)
BUILDDIR=rel-mac-xcode
CMAKE_OPTIONS=" -DwxWidgets_CONFIG_EXECUTABLE=$HOME/src/wx315_opencpn50_macos1010/bin/wx-config
-DwxWidgets_CONFIG_OPTIONS='--prefix=$HOME/src/wx312_opencpn50_macos1010'
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 -G Xcode"
export CMAKE_BUILD_PARALLEL_LEVEL=8
;;
pvlinux*) # Parallels box with small RAM allocation
export CMAKE_BUILD_PARALLEL_LEVEL=2
;;
kees-tp) # Lenovo X1E2 8core
export CMAKE_BUILD_PARALLEL_LEVEL=16
;;
esac
if [ "$BUILDDIR" = "" ]
then
echo "Building unofficial release, old style package."
TARGET="pkg"
STATE="unofficial"
BUILDDIR="rel-`uname`-`uname -m`"
fi
[ $(uname) = "Darwin" ] && export MACOSX_DEPLOYMENT_TARGET=10.9
[ -d $BUILDDIR ] && rm -rf $BUILDDIR
mkdir -p $BUILDDIR
set -x
cd $BUILDDIR
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TYPE="${BUILD_TYPE}" ${CMAKE_OPTIONS} ..
echo "-------------------------- MAKE $MAKE_OPTIONS $TARGET -----------------------"
make $MAKE_OPTIONS $TARGET