批处理构建
This commit is contained in:
42
AutoBuild.bat
Normal file
42
AutoBuild.bat
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user