-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclean-cmake.bat
More file actions
37 lines (31 loc) · 1.03 KB
/
clean-cmake.bat
File metadata and controls
37 lines (31 loc) · 1.03 KB
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\x64-Release-Win-GCC"
set "SOLUTION_DIR=%WORKSPACE_DIR%\build"
if EXIST %SOLUTION_DIR% (
cmake --build %BUILD_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