forked from jpvanoosten/LearningDirectX12
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenerateProjectFiles.bat
56 lines (46 loc) · 1.81 KB
/
GenerateProjectFiles.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
53
54
55
56
@ECHO OFF
PUSHD %~dp0
REM Update these lines if the currently installed version of Visual Studio is not 2017.
SET VSWHERE="%~dp0\Tools\vswhere\vswhere.exe"
SET CMAKE="%~dp0\Tools\cmake-3.13.3-win64-x64\bin\cmake.exe"
REM Detect latest version of Visual Studio.
FOR /F "usebackq delims=." %%i IN (`%VSWHERE% -latest -prerelease -requires Microsoft.VisualStudio.Workload.NativeGame -property installationVersion`) DO (
SET VS_VERSION=%%i
)
IF %VS_VERSION% == 16 (
SET CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
SET CMAKE_BINARY_DIR=build_vs2019
) ELSE IF %VS_VERSION% == 15 (
SET CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
SET CMAKE_BINARY_DIR=build_vs2017
) ELSE IF %VS_VERSION% == 14 (
SET CMAKE_GENERATOR="Visual Studio 14 2015 Win64"
SET CMAKE_BINARY_DIR=build_vs2015
) ELSE (
ECHO.
ECHO ***********************************************************************
ECHO * *
ECHO * ERROR *
ECHO * *
ECHO ***********************************************************************
ECHO No compatible version of Microsoft Visual Studio detected.
ECHO Please make sure you have Visual Studio 2015 ^(or newer^) and the
ECHO "Game Development with C++" workload installed before running this script.
ECHO.
PAUSE
GOTO :Exit
)
ECHO CMake Generator: %CMAKE_GENERATOR%
ECHO CMake Binary Directory: %CMAKE_BINARY_DIR%
ECHO.
MKDIR %CMAKE_BINARY_DIR% 2>NUL
PUSHD %CMAKE_BINARY_DIR%
%CMAKE% -G %CMAKE_GENERATOR% -Wno-dev "%~dp0"
IF %ERRORLEVEL% NEQ 0 (
PAUSE
) ELSE (
START LearningDirectX12.sln
)
:Exit
POPD
POPD