-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildDriverAndGetInstaller.bat
More file actions
63 lines (53 loc) · 1.48 KB
/
BuildDriverAndGetInstaller.bat
File metadata and controls
63 lines (53 loc) · 1.48 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@echo off
:: Set paths
set BUILD_DIR=External/softcam/temp_build
set SOURCE_DIR=External/softcam
set OUTPUT_DIR=Binaries
if not exist "%SOURCE_DIR%" (
echo Failed to find Softcam library
exit /b 1
)
:: Create the build directory if it doesn't exist
if not exist "%BUILD_DIR%" (
mkdir "%BUILD_DIR%"
)
:: Run CMake with the specified option
cmake -DBUILD_SOFTCAM_DRIVER=ON -S "%SOURCE_DIR%" -B "%BUILD_DIR%"
if errorlevel 1 (
echo CMake configuration failed!
exit /b 1
)
:: Build the project
cmake --build "%BUILD_DIR%" --config Release
if errorlevel 1 (
echo Build failed!
exit /b 1
)
:: Ensure the output directory exists
if not exist "%OUTPUT_DIR%" (
mkdir "%OUTPUT_DIR%"
)
:: Copy the output files to the Driver folder
copy /y "%BUILD_DIR%\src\softcam\Release\softcam.dll" "%OUTPUT_DIR%\"
copy /y "%BUILD_DIR%\examples\softcam_installer\Release\softcam_installer.exe" "%OUTPUT_DIR%\"
:: Check if the files were copied successfully
if exist "%OUTPUT_DIR%\softcam.dll" (
echo softcam.dll copied successfully.
) else (
echo Failed to copy softcam.dll.
)
if exist "%OUTPUT_DIR%\softcam_installer.exe" (
echo softcam_installer.exe copied successfully.
) else (
echo Failed to copy softcam_installer.exe.
)
:: Delete the build directory
echo Removing build directory...
rmdir /s /q "%BUILD_DIR%"
if errorlevel 1 (
echo Failed to remove build directory.
) else (
echo Build directory removed successfully.
)
echo Build and cleanup process completed.
pause