-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_project.sh
More file actions
53 lines (44 loc) · 1.32 KB
/
Copy pathbuild_project.sh
File metadata and controls
53 lines (44 loc) · 1.32 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
#!/bin/bash
# Function to print messages
print_info() {
echo -e "\033[1;34m[INFO]\033[0m $1"
}
print_error() {
echo -e "\033[1;31m[ERROR]\033[0m $1"
}
print_success() {
echo -e "\033[1;32m[SUCCESS]\033[0m $1"
}
# Check for GLAD
print_info "Checking for GLAD..."
if [ ! -f "libs/glad/include/glad/glad.h" ]; then
print_error "libs/glad/include/glad/glad.h NOT FOUND!"
print_error "You MUST download GLAD as per the README."
print_error "1. Go to https://glad.dav1d.de/"
print_error "2. Generate for C/C++, OpenGL 3.3 Core."
print_error "3. Extract include and src folders to libs/glad/"
exit 1
fi
# Check for CMake
print_info "Searching for CMake..."
if ! command -v cmake &> /dev/null; then
print_error "CMake not found. Please install CMake (sudo apt install cmake)."
exit 1
fi
print_info "Found CMake."
# Build
print_info "Generating Build Files..."
cmake -S . -B build
if [ $? -ne 0 ]; then
print_error "CMake Generation failed."
print_error "You might need to install dependencies:"
print_error "sudo apt install build-essential libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev"
exit 1
fi
print_info "Building..."
cmake --build build
if [ $? -ne 0 ]; then
print_error "Build failed."
exit 1
fi
print_success "Build Complete. Run ./build/bin/OpenGLCube"