summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDrNuget <drnuget@outlook.com>2026-01-04 22:12:24 +0200
committerDrNuget <drnuget@outlook.com>2026-01-04 22:12:24 +0200
commit510f1bac9b71ba240d30bb5bc5df6501e70fafc9 (patch)
tree7bc48763071a8c315b82e638a267411c3453dd09 /CMakeLists.txt
downloadopengl-test-510f1bac9b71ba240d30bb5bc5df6501e70fafc9.tar.gz
Working 3D with .obj file loading
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..19537c4
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required(VERSION 4.2.0)
+
+set(CMAKE_C_STANDARD 99)
+set(CMAKE_C_STANDARD_REQUIRED ON)
+
+project(opengl_test)
+
+find_package(SDL3 REQUIRED)
+include_directories(${SDL3_INCLUDE_DIRS})
+
+find_package(OpenGL REQUIRED)
+
+FILE(GLOB CSources src/*)
+
+add_executable(${PROJECT_NAME} ${CSources})
+
+include(FetchContent)
+
+FetchContent_Declare(
+ glad
+ GIT_REPOSITORY https://github.com/Dav1dde/glad.git
+ GIT_TAG v2.0.8
+ SOURCE_SUBDIR cmake
+)
+FetchContent_MakeAvailable(glad)
+glad_add_library(glad_gl_core_33 REPRODUCIBLE STATIC API gl:core=3.3)
+
+FetchContent_Declare(
+ cglm
+ GIT_REPOSITORY https://github.com/recp/cglm
+ GIT_TAG v0.9.5
+)
+FetchContent_MakeAvailable(cglm)
+
+target_link_libraries(${PROJECT_NAME}
+ SDL3::SDL3
+ OpenGL::GL
+ glad_gl_core_33
+ cglm
+ assimp
+ m
+)
+
+target_compile_options(${PROJECT_NAME} PUBLIC -Wall -Wextra -Wpedantic -g)
+
+#add_subdirectory(external/cglm/ EXCLUDE_FROM_ALL)