blob: e7004fd8a4e84329f5675787b1b78ae4dd56bc62 (
plain)
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
|
#!/bin/bash
set -e -x
LOCAL_DIRNAME="$(dirname "$0")"
#LOCAL_DIRNAME="${PWD}/$(dirname "$0")"
source "$LOCAL_DIRNAME/detect_qmake.sh"
# Prints number of cores to stdout
GetCPUCores() {
case "$OSTYPE" in
linux-gnu) grep -c ^processor /proc/cpuinfo 2>/dev/null
;;
darwin*) sysctl -n hw.ncpu
;;
*) echo "Unsupported platform in $0"
exit 1
;;
esac
return 0
}
# 1st param: shadow directory path
# 2nd param: mkspec
# 3rd param: additional qmake parameters
BuildQt() {
(
# set qmake path
PATH="$(PrintQmakePath):$PATH" || ( echo "ERROR: qmake was not found, please add it to your PATH or into the tools/autobuild/detect_qmake.sh"; exit 1 )
SHADOW_DIR="$1"
MKSPEC="$2"
QMAKE_PARAMS="$3"
mkdir -p "$SHADOW_DIR"
cd "$SHADOW_DIR"
qmake -r "$QMAKE_PARAMS" -spec "$MKSPEC" "$LOCAL_DIRNAME/../../omim.pro"
# make clean > /dev/null || true
make -j $(GetCPUCores)
)
}
|