-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclean-cmake.bat
37 lines (31 loc) · 1 KB
/
clean-cmake.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@echo off
rem Copyright 2019-present, Joseph Garnier
rem All rights reserved.
rem
rem This source code is licensed under the license found in the
rem LICENSE file in the root directory of this source tree.
rem =============================================================================
rem What Is This?
rem -------------
rem See README file in the root directory of this source tree.
setlocal EnableDelayedExpansion
set "WORKSPACE_DIR=%cd%"
set "BUILD_DIR=%WORKSPACE_DIR%\build"
set "SOLUTION_DIR=%BUILD_DIR%"
if EXIST %SOLUTION_DIR% (
cmake --build %SOLUTION_DIR% --target clean
rem Remove solution in build directory.
for /f "usebackq tokens=*" %%f in (`dir "%SOLUTION_DIR%\*" /a /b`) do (
if exist "%SOLUTION_DIR%\%%f\" (
rmdir "%SOLUTION_DIR%\%%f" /s /q
echo Directory deleted - %SOLUTION_DIR%\%%~f
) else if not "%%f" == ".gitignore" (
del "%SOLUTION_DIR%\%%~f" /a /f /q
echo File deleted - %SOLUTION_DIR%\%%~f
)
)
)
if %errorlevel%==0 (
echo.The solution was successfully cleaned!
)
pause