forked from BoseBrezel/cosmoscout-vr
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.a_First_Time_Build.bat
More file actions
129 lines (111 loc) · 3.43 KB
/
Copy path.a_First_Time_Build.bat
File metadata and controls
129 lines (111 loc) · 3.43 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
@echo off
setlocal enabledelayedexpansion
title CosmoScout VR Build and Run Script
REM =====================================================
REM 0. Submodules & Build Externals
REM =====================================================
echo.
echo Updating submodules...
git submodule update --init --recursive
echo.
echo Building externals...
.\make_externals.bat -G "Visual Studio 17 2022" -A x64
REM =====================================================
REM 1. CMake-Konfiguration
REM =====================================================
echo.
echo Starting CMake configuration...
cmake --preset windows-vs-release-config -G "Visual Studio 17 2022" -A x64
if errorlevel 1 (
echo.
echo Error while configuring CMake!
REM =====================================================
REM 1.2. Bei Fehler alten Build-Ordner löschen
REM =====================================================
set "BUILD_PATH=C:\Repos\cosmoscout-vr\build\windows-Release"
if exist "%BUILD_PATH%" (
echo.
echo Deleting \build\windows-Release...
rmdir /S /Q "%BUILD_PATH%"
echo.
echo Folder deleted.
) else (
echo.
echo No folder found to delete.
)
echo Restarting CMake configuration...
cmake --preset windows-vs-release-config -G "Visual Studio 17 2022" -A x64
if errorlevel 1 (
echo.
echo Error while configuring CMake!
pause
exit /b 1
REM =====================================================
REM 1.3. Bei Fehler alten Build-Ordner löschen
REM =====================================================
set "BUILD_PATH=C:\Repos\cosmoscout-vr\build\windows-Release"
if exist "%BUILD_PATH%" (
echo.
echo Deleting \build\windows-Release...
rmdir /S /Q "%BUILD_PATH%"
echo.
echo Folder deleted.
) else (
echo.
echo No folder found to delete.
)
)
)
echo.
echo Completed CMake configuration.
REM =====================================================
REM 2. Build starten
REM =====================================================
echo.
echo Starting build process...
cmake --build --preset windows-vs-release-build
if errorlevel 1 (
echo.
echo Error while building!
pause
exit /b 1
)
echo.
echo Completed build.
REM =====================================================
REM 3. In Bin-Verzeichnis wechseln
REM =====================================================
set "BIN_PATH=C:\Repos\cosmoscout-vr\install\windows-Release\bin"
if exist "%BIN_PATH%" (
cd /d "%BIN_PATH%"
echo.
echo Changing directory to "%BIN_PATH%"
) else (
echo.
echo Error: Directory not found!
pause
exit /b 1
)
REM =====================================================
REM 4. Benutzer-Eingabe: VR oder 2D
REM =====================================================
echo.
echo Start CosmoScout in
echo vr - Head-Mounted Display (Standard)
echo 2d - Windowed-Mode
echo.
set /p MODE=Choose [vr] or [2d]:
if "%MODE%"=="" set MODE=vr
if /I "%MODE%"=="2d" (
echo Starting 2D mode
start "CosmoScout 2D" cmd /c "cd /d "%BIN_PATH%" && start.bat"
) else if /I "%MODE%"=="vr" (
echo Starting VR mode
start "CosmoScout VR" cmd /c "cd /d "%BIN_PATH%" && hmd.bat"
) else (
echo Unknown input, starting standard (VR)
start "CosmoScout VR" cmd /c "cd /d "%BIN_PATH%" && hmd.bat"
)
echo.
echo Started CosmoScout.
exit /b 0