Files
VulkanRenderer/CMakeLists.txt
2025-11-16 17:06:24 +00:00

49 lines
1.1 KiB
CMake

# Sets minimum CMake and C++ Standard version #
cmake_minimum_required (VERSION 4.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
project(VulkanRendererProject)
include(FetchContent)
# Adds Vulkan to the project #
FetchContent_Declare(
VulkanHeaders
GIT_REPOSITORY https://github.com/KhronosGroup/Vulkan-Headers.git
GIT_TAG v1.3.296
)
FetchContent_MakeAvailable(VulkanHeaders)
find_package(Vulkan REQUIRED)
# Adds GLFW for window creation #
FetchContent_Declare(
glfw
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.4
)
FetchContent_MakeAvailable(glfw)
# Creates the output binary
project(VulkanRenderer LANGUAGES CXX)
add_executable(VulkanRenderer
main.cpp
src/managers/GLFWManager.h
src/managers/GLFWManager.cpp
src/managers/VulkanManagerInit.cpp
src/managers/VulkanManagerRender.cpp
src/managers/VulkanManager.h
src/VulkanRenderer.h
)
target_precompile_headers(VulkanRenderer PRIVATE src/VulkanRenderer.h)
# Links the libraries to the binary #
target_link_libraries(VulkanRenderer PRIVATE
Vulkan::Vulkan
glfw
)