feat: add OpenGL abstraction layer with RAII resources
- Replace window class with cbt::opengl::context - Add buffer resource (VBO, EBO, UBO, SSBO) with move semantics - Add texture resource with format/type enums and filtering - Add descriptor_set for Vulkan-style resource binding - All resources use RAII with proper cleanup
This commit is contained in:
Vendored
+76
@@ -0,0 +1,76 @@
|
||||
# ==============================================================================
|
||||
# Find spdlog
|
||||
# ==============================================================================
|
||||
# This module fetches the spdlog logging library.
|
||||
#
|
||||
# Targets provided:
|
||||
# spdlog::spdlog - The spdlog library target
|
||||
#
|
||||
# Variables set:
|
||||
# spdlog_FOUND - TRUE if spdlog is available
|
||||
# spdlog_LIBRARIES - The spdlog library target (spdlog::spdlog)
|
||||
# spdlog_INCLUDE_DIR - Include directories for spdlog
|
||||
# spdlog_VERSION - Version of spdlog (if available)
|
||||
# ==============================================================================
|
||||
|
||||
if (DEFINED _FINDSPDLOG_INCLUDED)
|
||||
return()
|
||||
endif()
|
||||
set(_FINDSPDLOG_INCLUDED TRUE)
|
||||
|
||||
# Use the version passed to find_package(), or default to v1.17.0
|
||||
# spdlog tags are prefixed with 'v', so prepend it if not already present
|
||||
if (DEFINED spdlog_FIND_VERSION AND NOT spdlog_FIND_VERSION STREQUAL "")
|
||||
set(SPDLOG_VERSION "v${spdlog_FIND_VERSION}")
|
||||
else()
|
||||
set(SPDLOG_VERSION "v1.17.0")
|
||||
endif()
|
||||
|
||||
message(STATUS "Fetching spdlog ${SPDLOG_VERSION}")
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
find_program(GIT_EXECUTABLE git)
|
||||
if (GIT_EXECUTABLE)
|
||||
set(SPDLOG_FETCH_METHOD "GIT")
|
||||
else()
|
||||
set(SPDLOG_FETCH_METHOD "ZIP")
|
||||
endif()
|
||||
|
||||
if (SPDLOG_FETCH_METHOD STREQUAL "GIT")
|
||||
FetchContent_Declare(
|
||||
spdlog
|
||||
GIT_REPOSITORY https://github.com/gabime/spdlog.git
|
||||
GIT_TAG ${SPDLOG_VERSION}
|
||||
)
|
||||
else()
|
||||
FetchContent_Declare(
|
||||
spdlog
|
||||
URL https://github.com/gabime/spdlog/archive/refs/tags/${SPDLOG_VERSION}.zip
|
||||
)
|
||||
endif()
|
||||
|
||||
FetchContent_MakeAvailable(spdlog)
|
||||
|
||||
if (NOT TARGET spdlog::spdlog)
|
||||
if (TARGET spdlog)
|
||||
add_library(spdlog::spdlog ALIAS spdlog)
|
||||
else()
|
||||
message(FATAL_ERROR "Could not fetch spdlog; no target spdlog or spdlog::spdlog available")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(spdlog_FOUND TRUE)
|
||||
set(spdlog_LIBRARIES spdlog::spdlog)
|
||||
set(spdlog_VERSION "${SPDLOG_VERSION}")
|
||||
get_target_property(_spdlog_inc spdlog::spdlog INTERFACE_INCLUDE_DIRECTORIES)
|
||||
set(spdlog_INCLUDE_DIR "${_spdlog_inc}")
|
||||
|
||||
# Mark spdlog includes as SYSTEM to suppress warnings from its headers
|
||||
if (_spdlog_inc AND TARGET spdlog)
|
||||
set_target_properties(spdlog PROPERTIES
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_spdlog_inc}"
|
||||
)
|
||||
endif()
|
||||
|
||||
set(SPDLOG_LICENSE_FILE "${spdlog_SOURCE_DIR}/LICENSE" CACHE FILEPATH "Path to spdlog license file")
|
||||
Reference in New Issue
Block a user