r5sdk/CreateSolution.bat
Kawe Mazidjatari 048f8a6467 Create the runtime directory
Create the runtime (binary) directory while running the project generator.
2023-05-14 14:54:34 +02:00

39 lines
873 B
Batchfile

@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.