-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
36 lines (28 loc) · 1.01 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
@echo off
REM Function to replace destination binary path in Makefile (Windows equivalent)
setlocal
set "file=Makefile.Release"
set "string_to_replace=\\Hedgehog"
set "replacement_string=/Hedgehog"
REM Run qmake and make
qmake
REM Use PowerShell to replace the string
powershell -Command "(Get-Content %file%) -replace '%string_to_replace%', '%replacement_string%' | Set-Content %file%"
echo Replaced "%string_to_replace%" with "%replacement_string%" in "%file%".
set "file=Makefile.Release"
set "string_to_replace=Hedgehog\\"
set "replacement_string=Hedgehog/"
REM Use PowerShell to replace the string
powershell -Command "(Get-Content %file%) -replace '%string_to_replace%', '%replacement_string%' | Set-Content %file%"
echo Replaced "%string_to_replace%" with "%replacement_string%" in "%file%".
REM Clean previous builds
if exist build rmdir /S /Q build
mkdir build
make
REM Copy the final binary
if "%~1"=="" (
copy "build\Hedgehog.exe" "Hedgehog.exe"
) else (
copy "build\Hedgehog.exe" "Hedgehog-%~1.exe"
)
endlocal