-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_project.bat
More file actions
70 lines (60 loc) · 1.93 KB
/
build_project.bat
File metadata and controls
70 lines (60 loc) · 1.93 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
@echo off
setlocal
echo [INFO] Checking for GLAD...
if not exist "libs\glad\include\glad\glad.h" (
echo [ERROR] libs\glad\include\glad\glad.h NOT FOUND!
echo [ERROR] You MUST download GLAD as per the README.
echo [ERROR] 1. Go to https://glad.dav1d.de/
echo [ERROR] 2. Generate for C/C++, OpenGL 3.3 Core.
echo [ERROR] 3. Extract include and src folders to libs\glad\
pause
exit /b 1
)
echo [INFO] Searching for CMake...
:: Try standard system path
where cmake >nul 2>nul
if %errorlevel% equ 0 (
echo [INFO] Found CMake in PATH.
set CMAKE_CMD=cmake
goto :Build
)
:: Try common VS locations
set "VS_CMAKE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
if exist "%VS_CMAKE_PATH%" (
echo [INFO] Found CMake in VS Community 2022.
set "CMAKE_CMD=%VS_CMAKE_PATH%"
goto :Build
)
set "VS_CMAKE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
if exist "%VS_CMAKE_PATH%" (
echo [INFO] Found CMake in VS Professional 2022.
set "CMAKE_CMD=%VS_CMAKE_PATH%"
goto :Build
)
set "VS_CMAKE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe"
if exist "%VS_CMAKE_PATH%" (
echo [INFO] Found CMake in VS Enterprise 2022.
set "CMAKE_CMD=%VS_CMAKE_PATH%"
goto :Build
)
echo [ERROR] CMake not found. Please install CMake or use Visual Studio "Open Folder".
pause
exit /b 1
:Build
echo [INFO] Using CMake: "%CMAKE_CMD%"
echo [INFO] Generatign Build Files...
"%CMAKE_CMD%" -S . -B build
if %errorlevel% neq 0 (
echo [ERROR] CMake Generation failed.
pause
exit /b 1
)
echo [INFO] Building...
"%CMAKE_CMD%" --build build
if %errorlevel% neq 0 (
echo [ERROR] Build failed.
pause
exit /b 1
)
echo [SUCCESS] Build Complete. Run build\bin\OpenGLCube.exe
pause