-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathCreateSolution.bat
More file actions
38 lines (32 loc) · 873 Bytes
/
CreateSolution.bat
File metadata and controls
38 lines (32 loc) · 873 Bytes
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
@echo off
setlocal
set BUILDDIR=build_intermediate
set BINDIR=game
REM Check for Visual Studio versions in order
for %%V in (15 16 17) do (
reg query "HKEY_CLASSES_ROOT\VisualStudio.DTE.%%V.0" >> nul 2>&1
if NOT ERRORLEVEL 1 (
if "%%V"=="15" (
set "CMAKE_GENERATOR=Visual Studio 15 2017"
) else if "%%V"=="16" (
set "CMAKE_GENERATOR=Visual Studio 16 2019"
) else if "%%V"=="17" (
set "CMAKE_GENERATOR=Visual Studio 17 2022"
)
echo Using Visual Studio %%V as generator.
goto :build
)
)
echo Could not find a supported version of Visual Studio; exiting...
exit /b 1
:build
if not exist "%BUILDDIR%" (
mkdir "%BUILDDIR%"
)
if not exist "%BINDIR%" (
mkdir "%BINDIR%"
)
cd "%BUILDDIR%"
cmake .. -G"%CMAKE_GENERATOR%" -A"x64"
cd ..
echo Finished generating solution files.