Kylin/resource/deploy.sh

50 lines
966 B
Bash
Raw Normal View History

2023-07-21 10:47:31 +08:00
#!/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 \
2023-07-21 14:07:27 +08:00
-DBOOST_ROOT=${libraries_root}/boost_1_82_0 \
-DZeroMQ_ROOT=${libraries_root}/zeromq-4.3.4_debug
2023-07-21 10:47:31 +08:00
}
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 $@