45 lines
1.3 KiB
Batchfile
45 lines
1.3 KiB
Batchfile
@echo off
|
|
rem ===========================================================================
|
|
rem CMake clean script - remove the build output of one configuration.
|
|
rem
|
|
rem Usage:
|
|
rem clean.bat ^<PHASE_SCANNING^|MECHANICAL_SCANNING^> ^<Debug^|Release^> [AUTO^|ON^|OFF]
|
|
rem
|
|
rem Examples:
|
|
rem clean.bat PHASE_SCANNING Release OFF
|
|
rem clean.bat MECHANICAL_SCANNING Debug ON
|
|
rem
|
|
rem The directory removed is the same one configure.bat/build.bat use:
|
|
rem build\<X256_PS^|X256_MS^>\<Debug^|Release^>\<REC_AUTO^|REC_OFF^|REC_ON^>
|
|
rem Use clean_all.bat to clean every configuration at once.
|
|
rem
|
|
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
|
rem ===========================================================================
|
|
setlocal
|
|
if "%~1"=="" goto :usage
|
|
if "%~2"=="" goto :usage
|
|
|
|
call "%~dp0config_paths.bat" "%~1" "%~2" "%~3"
|
|
if errorlevel 1 exit /b 1
|
|
|
|
pushd "%~dp0..\.."
|
|
if not exist "%BUILD_DIR%" (
|
|
echo [clean] "%BUILD_DIR%" does not exist - nothing to do
|
|
popd
|
|
exit /b 0
|
|
)
|
|
|
|
echo [clean] remove "%BUILD_DIR%"
|
|
rmdir /s /q "%BUILD_DIR%"
|
|
if exist "%BUILD_DIR%" (
|
|
echo [ERROR] cannot remove "%BUILD_DIR%", close open files and retry.
|
|
popd
|
|
exit /b 1
|
|
)
|
|
popd
|
|
exit /b 0
|
|
|
|
:usage
|
|
echo Usage: clean.bat ^<PHASE_SCANNING^|MECHANICAL_SCANNING^> ^<Debug^|Release^> [AUTO^|ON^|OFF^]
|
|
exit /b 1
|