You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#!/bin/bash
# Drone_project项目构建脚本( shadow build, 系统 qmake)
echo "=== 构建Drone_project项目 ==="
# 仅使用系统 qmake, 确保团队环境一致
if ! command -v qmake >/dev/null 2>& 1; then
echo "✗ 未找到系统 qmake。请先安装: sudo apt install -y qtbase5-dev qtwebengine5-dev"
exit 1
fi
QMAKE_BIN = "qmake"
echo " 使用 qmake: ${ QMAKE_BIN } (from PATH) "
# 准备构建目录( shadow build)
echo "1. 准备构建目录..."
mkdir -p build || exit 1
rm -rf build/*
# 进入构建目录并生成构建文件
echo "2. 生成构建文件..."
(
cd build && " ${ QMAKE_BIN } " ../drone_ui.pro
) || { echo "✗ qmake 失败" ; exit 1; }
# 编译项目
echo "3. 编译项目..."
(
cd build && make -j
) || { echo "✗ 编译失败" ; exit 1; }
# 检查编译结果
if [ -f "build/Drone_project" ] ; then
echo "✓ 编译成功!可执行文件位置: build/Drone_project"
else
echo "✗ 没找到可执行文件 build/Drone_project"
exit 1
fi
echo "=== 构建完成 ==="