Files
bishe-QT_MainWindow/build.bat
T
2026-05-01 10:51:39 +08:00

50 lines
1.0 KiB
Batchfile

@echo off
REM 人脸识别考勤系统 - Qt查看器编译脚本 (Windows)
echo =========================================
echo 编译 AttendanceViewer
echo =========================================
REM 检查是否设置了Qt环境变量
where qmake >nul 2>&1
if %errorlevel% neq 0 (
echo 错误: 未找到 qmake,请先设置 Qt 环境变量
echo 或使用 Qt Creator 打开项目
pause
exit /b 1
)
REM 清理旧的编译文件
echo [1/4] 清理旧的编译文件...
if exist build rmdir /s /q build
if exist bin rmdir /s /q bin
mkdir build
REM 进入构建目录
cd build
REM 生成 Makefile
echo [2/4] 生成 Makefile...
qmake ..\AttendanceViewer.pro
REM 编译
echo [3/4] 编译项目...
mingw32-make
REM 检查编译结果
if %errorlevel% equ 0 (
echo [4/4] 编译成功!
echo.
echo =========================================
echo 运行程序:
echo cd ..\bin
echo AttendanceViewer.exe
echo =========================================
) else (
echo [4/4] 编译失败!
pause
exit /b 1
)
pause