Kylin/resource/deploy.sh
2023-07-21 14:07:27 +08:00

50 lines
966 B
Bash

#!/bin/bash
base_path=$(pwd)
libraries_root="/opt/Libraries"
if [ $base_path == /home/* ] || [ -n "${DRONE}" ]; then
build_path=${base_path}/build
else
build_path=/tmp/build
fi
echo "build directory: $build_path"
function cmake_scan() {
if [ ! -d ${build_path} ]; then
mkdir ${build_path}
fi
/opt/Qt/Tools/CMake/bin/cmake \
-G Ninja \
-S ${base_path} \
-B ${build_path} \
-DCMAKE_BUILD_TYPE=Debug \
-DBOOST_ROOT=${libraries_root}/boost_1_82_0 \
-DZeroMQ_ROOT=${libraries_root}/zeromq-4.3.4_debug
}
function build() {
if [ ! -f "${build_path}/CMakeCache.txt" ]; then
cmake_scan
fi
if [ $? -ne 0 ]; then
exit 1
fi
/opt/Qt/Tools/CMake/bin/cmake \
--build ${build_path} \
--target all
}
function main() {
local cmd=$1
shift 1
case $cmd in
build)
build
;;
*)
build
;;
esac
}
main $@