3 changed files with 50 additions and 4 deletions
@ -0,0 +1,40 @@ |
|||
@echo off |
|||
REM 测试CMake配置的脚本 |
|||
|
|||
REM 设置构建目录 |
|||
set BUILD_DIR=build_test |
|||
|
|||
REM 清理旧的构建目录 |
|||
if exist %BUILD_DIR% rmdir /s /q %BUILD_DIR% |
|||
|
|||
REM 创建构建目录 |
|||
mkdir %BUILD_DIR% |
|||
|
|||
REM 运行CMake配置 |
|||
pushd %BUILD_DIR% |
|||
cmake .. |
|||
if %ERRORLEVEL% neq 0 ( |
|||
echo CMake配置失败! |
|||
popd |
|||
exit /b 1 |
|||
) |
|||
|
|||
REM 构建项目 |
|||
cmake --build . --config Release |
|||
if %ERRORLEVEL% neq 0 ( |
|||
echo 构建失败! |
|||
popd |
|||
exit /b 1 |
|||
) |
|||
|
|||
popd |
|||
|
|||
REM 检查bin目录是否存在 |
|||
if exist bin ( |
|||
echo bin目录已创建 |
|||
dir bin |
|||
) else ( |
|||
echo bin目录未创建 |
|||
) |
|||
|
|||
pause |
|||
Loading…
Reference in new issue