From 25a4dac248f8864984d8ae0cf1899b6ae01ae98d Mon Sep 17 00:00:00 2001 From: taynpg Date: Tue, 31 Mar 2026 15:36:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E5=A4=84=E7=90=86=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoBuild.bat | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 AutoBuild.bat diff --git a/AutoBuild.bat b/AutoBuild.bat new file mode 100644 index 0000000..49f4474 --- /dev/null +++ b/AutoBuild.bat @@ -0,0 +1,42 @@ +@echo off +setlocal enabledelayedexpansion + +set "BUILD_DIR=build-release" +set "CMAKE_ARGS=-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=C:/local/tools/hello-cmake -DCMAKE_PREFIX_PATH=C:/local" +set "SUCCESS=true" + +echo [1/3] Running CMake configuration... +cmake -B%BUILD_DIR% -S. %CMAKE_ARGS% +if %errorlevel% neq 0 ( + echo Error: CMake configuration failed + set "SUCCESS=false" + goto :end +) +echo CMake configuration completed + +echo [2/3] Building project... +cmake --build %BUILD_DIR% --config Release +if %errorlevel% neq 0 ( + echo Error: Build failed + set "SUCCESS=false" + goto :end +) +echo Build completed + +echo [3/3] Installing project... +cmake --install %BUILD_DIR% --config Release +if %errorlevel% neq 0 ( + echo Error: Installation failed + set "SUCCESS=false" + goto :end +) +echo Installation completed + +:end +echo. +if "%SUCCESS%"=="true" ( + echo All steps completed successfully +) else ( + echo Process terminated with errors +) +pause