Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorv.greshilov <v.greshilov@msk-wifi-25fap2-v_greshilov-s.subbotin.mail.msk>2017-11-24 15:01:05 +0300
committerDaria Volvenkova <d.volvenkova@corp.mail.ru>2017-11-24 19:33:31 +0300
commit8e3a6b00b33b1d32ec21df3058f24667fc9023d4 (patch)
tree967ee1c0a10db08676147fff4dc3c84146bdb7b4 /tools
parent929eb113417093e4022f99d12897a45ee737150a (diff)
Removing qmake from generate_symbols.sh
Fixed detect_cmake.sh Chaned cmake detection method, added CMAKE env variable Review fixes All quote symbols in its right place Review fixes #2
Diffstat (limited to 'tools')
-rwxr-xr-xtools/autobuild/detect_cmake.sh16
-rwxr-xr-xtools/unix/generate_symbols.sh38
2 files changed, 30 insertions, 24 deletions
diff --git a/tools/autobuild/detect_cmake.sh b/tools/autobuild/detect_cmake.sh
new file mode 100755
index 0000000000..ef186f7fbc
--- /dev/null
+++ b/tools/autobuild/detect_cmake.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e -u
+
+# If CMAKE variable is set, use it
+[ -n "${CMAKE-}" -a -x "${CMAKE-}" ] && return 0
+
+# Find cmake, prefer cmake3
+for name in cmake3 cmake; do
+ if command -v "$name" > /dev/null; then
+ CMAKE="$name"
+ return 0
+ fi
+done
+
+echo 'Error: cmake is not installed.' >&2
+exit 1
diff --git a/tools/unix/generate_symbols.sh b/tools/unix/generate_symbols.sh
index efd355bd3c..b3ddc3fe14 100755
--- a/tools/unix/generate_symbols.sh
+++ b/tools/unix/generate_symbols.sh
@@ -5,36 +5,26 @@ set -e -u
export PYTHONDONTWRITEBYTECODE=1
OMIM_PATH="${OMIM_PATH:-$(cd "$(dirname "$0")/../.."; pwd)}"
-SKIN_GENERATOR="$OMIM_PATH/out/release/skin_generator"
+OUT_PATH="$OMIM_PATH/out/release"
+SKIN_GENERATOR="$OUT_PATH/skin_generator_tool"
DATA_PATH="$OMIM_PATH/data"
LOCAL_ADS_SYMBOLS_GENERATOR="$OMIM_PATH/tools/python/generate_local_ads_symbols.py"
# If skin_generator does not exist then build it
-if [ ! -f $SKIN_GENERATOR ];
+if [ ! -f "$SKIN_GENERATOR" ];
then
- source "$OMIM_PATH/tools/autobuild/detect_qmake.sh"
-
+ source "$OMIM_PATH/tools/autobuild/detect_cmake.sh"
# OS-specific parameters
if [ "$(uname -s)" == "Darwin" ]; then
- SPEC=${SPEC:-macx-clang}
PROCESSES=$(sysctl -n hw.ncpu)
else
- SPEC=${SPEC:-linux-clang-libc++}
PROCESSES=$(nproc)
fi
-
- for project in freetype gflags
- do
- cd "$OMIM_PATH/3party/$project"
- "$QMAKE" $project.pro -r -spec $SPEC CONFIG+=x86_64
- make -j $PROCESSES
- done
- for project in base coding geometry skin_generator
- do
- cd "$OMIM_PATH/$project"
- "$QMAKE" $project.pro -r -spec $SPEC CONFIG+=x86_64
- make -j $PROCESSES
- done
+ mkdir -p "$OUT_PATH"
+ pushd "$OUT_PATH" > /dev/null
+ "$CMAKE" "$OMIM_PATH" -DSKIP_TESTS:bool=true
+ make skin_generator_tool -j$PROCESSES
+ popd > /dev/null
fi
# Helper function to build skin
@@ -61,7 +51,7 @@ function BuildSkin() {
STYLE_PATH="$DATA_PATH/styles/$styleType/style-$styleName"
PNG_PATH="$STYLE_PATH/symbols/png"
rm -rf "$PNG_PATH" || true
- ln -s "$STYLE_PATH/$resourceName" $PNG_PATH
+ ln -s "$STYLE_PATH/$resourceName" "$PNG_PATH"
# Run sking generator
if [ $colorCorrection = "true" ]; then
COLOR_CORR="--colorCorrection true"
@@ -71,7 +61,7 @@ function BuildSkin() {
"$SKIN_GENERATOR" --symbolWidth $symbolSize --symbolHeight $symbolSize --symbolsDir "$STYLE_PATH/$symbolsFolder" \
--skinName "$DATA_PATH/resources-$resourceName$suffix/basic" --skinSuffix="$symbolsSuffix" $COLOR_CORR
# Reset environment
- rm -r $PNG_PATH || true
+ rm -r "$PNG_PATH" || true
}
# Cleanup
@@ -108,11 +98,11 @@ BuildSkin clear clear xhdpi 44 false _clear symbols-ad -ad
BuildSkin clear clear xxhdpi 68 false _clear symbols-ad -ad
BuildSkin clear clear 6plus 68 false _clear symbols-ad -ad
-rm -rf $OMIM_PATH/data/resources-{*}
+rm -rf "$OMIM_PATH"/data/resources-{*}
-rm -rf $OMIM_PATH/data/resources-*_design
+rm -rf "$OMIM_PATH"/data/resources-*_design
for i in mdpi hdpi xhdpi xxhdpi 6plus; do
- cp -r $OMIM_PATH/data/resources-${i}_clear/ $OMIM_PATH/data/resources-${i}_design/
+ cp -r "$OMIM_PATH"/data/resources-${i}_clear/ "$OMIM_PATH"/data/resources-${i}_design/
done
echo "Generate local ads symbols"