30ddaf7d39
- Add glm dependency for matrix transformations - Replace triangle with 6-face colored cube - Add MVP shader uniforms (model, view, projection) - Enable depth testing for proper 3D rendering - Spin cube around (1, 0.5, 0.3) axis style: fix trailing return type for move assignment operators - buffer/texture/shader/vao: use auto fn() -> T& style - Document trailing return type convention in AGENTS.md
35 lines
1017 B
CMake
35 lines
1017 B
CMake
cmake_minimum_required(VERSION 3.21)
|
|
project(cuber VERSION 0.1.0)
|
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|
|
|
# Add the deps directory to the module path
|
|
# Required for find_package injection
|
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps")
|
|
|
|
# Platform and compiler detection
|
|
include(Platform)
|
|
include(Flags)
|
|
|
|
# Dependencies
|
|
find_package(fmt REQUIRED)
|
|
find_package(glfw3 REQUIRED)
|
|
find_package(glad REQUIRED)
|
|
find_package(asio REQUIRED)
|
|
find_package(glm REQUIRED)
|
|
|
|
# Target setup
|
|
add_executable(cuber "cuber.cpp"
|
|
"cbt/opengl/context.cpp"
|
|
"cbt/opengl/buffer.cpp"
|
|
"cbt/opengl/texture.cpp"
|
|
"cbt/opengl/descriptor.cpp"
|
|
"cbt/opengl/shader.cpp"
|
|
"cbt/opengl/vao.cpp"
|
|
)
|
|
target_include_directories(cuber PRIVATE ".")
|
|
target_compile_features(cuber PRIVATE cxx_std_23)
|
|
target_compile_options(cuber PRIVATE ${BASE_OPTIONS})
|
|
target_compile_definitions(cuber PRIVATE ${BASE_DEFINITIONS})
|
|
target_link_libraries(cuber PRIVATE fmt::fmt glfw::glfw glad::glad asio::asio glm::glm ${BASE_LIBRARIES})
|