This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
/
build.bat
52 lines (43 loc) · 1.4 KB
/
build.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
:start
@echo off
cls
setlocal enabledelayedexpansion
set "msbuildPath=C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
set "solutionPath=F:\Repositories\RealTimeFaceRecognition\RealtimeFacialRecognition.sln"
set "buildPath=F:\Repositories\RealTimeFaceRecognition\x64"
set "vcpkgPath=F:\Repositories\vcpkg"
:: Prepare library packages, if not exist.
call %vcpkgPath%\bootstrap-vcpkg.bat
%vcpkgPath%\vcpkg install curl
%vcpkgPath%\vcpkg install opencv4
%vcpkgPath%\vcpkg install dlib
%vcpkgPath%\vcpkg integrate install
:: Remove existing build folder if it exists.
IF EXIST "%buildPath%" (
rmdir /s /q "%buildPath%"
)
:: Build the solution using MSBuild.
"%msbuildPath%" "%solutionPath%" /p:Configuration=Release /m /v:m
if exist "%buildPath%\Debug\" (
set "binPath=%buildPath%\Debug\"
) else (
set "binPath=%buildPath%\Release\"
)
echo binPath is set to: %binPath%
:: Delete unnecessary files from the release folder.
echo --- Some errors may show up, depending on which build mode has been used. Don't worry ---
del /s /q "%binPath%*.log"
del /s /q "%binPath%*.pdb"
del /s /q "%binPath%*.obj"
del /s /q "%binPath%*.idb"
del /s /q "%binPath%*.ilk"
del /s /q "%binPath%*.iobj"
del /s /q "%binPath%*.ipdb"
del /s /q "%binPath%*.recipe"
del /s /q "%binPath%*.txt"
del /s /q "%binPath%vcpkg.applocal.log
rmdir /s /q "%binPath%Realtime.53afeaad.tlog"
pause
endlocal
goto start
exit