-
Notifications
You must be signed in to change notification settings - Fork 10
/
build.sh
executable file
·69 lines (65 loc) · 2 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
#!/bin/bash
#============================================================================
# AirspaceConverter
# Since : 9/12/2017
# Author : Alberto Realis-Luc <[email protected]>
# Web : https://www.alus.it/AirspaceConverter
# Copyright : (C) 2016-2024 Alberto Realis-Luc
# License : GNU GPL v3
#
# This script is part of AirspaceConverter project
#============================================================================
# On Linux: to run this script it is necessary to have lsb-release installed
# First find out where we want to build and number of processors available
QMAKE=qmake
if [ "$(uname)" == "Darwin" ]; then
SYSTEM="macOS"
PROCESSORS=2
echo "Building everything for macOS ..."
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
SYSTEM="Linux"
PROCESSORS="$(grep -c ^processor /proc/cpuinfo)"
echo "Building everything for Linux ..."
if (test `lsb_release -si` = "Fedora") then
QMAKE=qmake-qt4
fi
else
echo "ERROR: Unknown operating system."
exit 1
fi
# Build shared library and command line version
echo "Building AirspaceConverter shared library and CLI executable ..."
make -j${PROCESSORS} all
if [ "$?" -ne 0 ]; then
echo "ERROR: Failed to compile shared library and CLI executable."
exit 1
fi
# Build Qt user interface
echo "Building AirspaceConverter Qt GUI ..."
mkdir -p buildQt
cd buildQt
if [ ${SYSTEM} == "Linux" ]; then
$QMAKE ../AirspaceConverterQt/AirspaceConverterQt.pro -r -spec linux-g++-64
else
$QMAKE ../AirspaceConverterQt/AirspaceConverterQt.pro -r -spec macx-clang CONFIG+=x86_64
fi
if [ "$?" -ne 0 ]; then
echo "ERROR: Failed to run qmake."
cd ..
exit 1
fi
make -j${PROCESSORS} all
if [ "$?" -ne 0 ]; then
echo "ERROR: Failed to compile Qt user interface."
cd ..
exit 1
fi
if [ ${SYSTEM} == "Linux" ]; then
strip -S --strip-unneeded ./airspaceconverter-gui
mv ./airspaceconverter-gui ../Release/airspaceconverter-gui
else
strip -S ./airspaceconverter-gui.app/Contents/MacOS/airspaceconverter-gui
fi
cd ..
echo "Full build done."
exit 0