forked from godotengine/godot-cpp-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvs.bat
52 lines (40 loc) · 1.14 KB
/
vs.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
@echo off
setlocal
:: Check, if want release or debug
choice /C RD /M "Do you want to generate a release or debug project?"
if %ERRORLEVEL% equ 1 (
set "buildType=Release"
) else (
set "buildType=Debug"
)
if exist .sln/%buildType% (
@REM Delete the .sln folder
rmdir /s /q .sln/%buildType%
)
mkdir .sln
mkdir ".sln\%buildType%"
pushd ".sln\%buildType%"
cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=%buildType% ../..
if %ERRORLEVEL% neq 0 (
echo CMake failed.
pause
exit /b %ERRORLEVEL%
)
REM Create a shortcut to the .sln file
set "shortcutName=Project.sln"
set "targetPath=%~dp0.sln\%buildType%\Godot-Kafka.sln"
set "shortcutPath=%~dp0%shortcutName%.lnk"
:: Delete the shortcut if it already exists
if exist "%shortcutPath%" (
del "%shortcutPath%"
)
REM Check if the shortcut already exists
if exist "%shortcutPath%" (
echo Shortcut already exists.
) else (
echo Creating shortcut...
powershell -Command "$WshShell = New-Object -ComObject WScript.Shell; $Shortcut = $WshShell.CreateShortcut('%shortcutPath%'); $Shortcut.TargetPath = '%targetPath%'; $Shortcut.Save()"
)
start %shortcutPath%
endlocal
exit /b