Files
build_tools/scripts/deploy
2019-08-26 19:17:23 +03:00

68 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
SCRIPTPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source ./scripts/config_value module OO_MODULE "desktop builder"
source ./scripts/config_value platform OO_PLATFORM native
source ./scripts/config_value qt-dir OO_QT_DIR "set qt path"
source ./scripts/config_value compiler OO_COMPILER gcc
OO_COMPILER_X64="${OO_COMPILER}_64"
IS_NEED_64=false
IS_NEED_32=false
if [[ "$OO_PLATFORM" == *"all"* ]]
then
IS_NEED_64=true
IS_NEED_32=true
fi
if [[ "$OO_PLATFORM" == *"x64"* ]] || \
[[ "$OO_PLATFORM" == *"linux_64"* ]] || \
[[ "$OO_PLATFORM" == *"mac_64"* ]]
then
IS_NEED_64=true
fi
if [[ "$OO_PLATFORM" == *"x86"* ]] || \
[[ "$OO_PLATFORM" == *"linux_32"* ]]
then
IS_NEED_32=true
fi
if [[ "$OO_PLATFORM" == *"native"* ]]
then
architecture=$(uname -m)
case "$architecture" in
x86_64*) IS_NEED_64=true ;;
*) IS_NEED_32=true ;;
esac
fi
OO_OS=$(uname -s)
OS_DEPLOY_64=""
case "$OO_OS" in
Linux*) OS_DEPLOY_64="linux_64" ;;
Darwin*) OS_DEPLOY_64="mac_64" ;;
*) exit ;;
esac
if [[ "$OS_DEPLOY_64" == "mac_64" ]]
then
IS_NEED_32=false
fi
if [[ "$IS_NEED_64" == true ]]
then
export QT_DEPLOY="${OO_QT_DIR}/${OO_COMPILER_X64}/bin"
export OS_DEPLOY=$OS_DEPLOY_64
"$QT_DEPLOY/qmake" -nocache "$SCRIPTPATH/deploy.pro" "CONFIG+=$OO_CONFIG $OO_MODULE"
fi
if [[ "$IS_NEED_32" == true ]]
then
export QT_DEPLOY="${OO_QT_DIR}/${OO_COMPILER}/bin"
export OS_DEPLOY=linux_32
"$QT_DEPLOY/qmake" -nocache "$SCRIPTPATH/deploy.pro" "CONFIG+=$OO_CONFIG $OO_MODULE"
fi