-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
56 lines (40 loc) · 1.4 KB
/
CMakeLists.txt
File metadata and controls
56 lines (40 loc) · 1.4 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
# CMakeLists.txt in project-root
cmake_minimum_required(VERSION 3.23)
# Ensure MSVC targets link the correct C runtime (DLL variant).
# Required for VS 2026+ / MSVC 19.50+ where auto-linking may not
# inject the CRT libs unless the policy is explicitly set.
cmake_policy(SET CMP0091 NEW)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
project(VulkanSceneRenderer)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
# Include third-party dependencies
include(cmake/Options.cmake)
include(cmake/Dependencies.cmake)
add_subdirectory(src)
# Shader compilation and asset generation (modular includes)
include(cmake/Shaders.cmake)
include(cmake/Assets.cmake)
# Main executable
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE
VulkanSceneRenderer_Core
)
target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# Wire asset dependencies to the executable
if(TARGET shaders)
add_dependencies(${PROJECT_NAME} shaders)
endif()
add_dependencies(${PROJECT_NAME} copy_materials)
add_dependencies(${PROJECT_NAME} generate_models)
if(TARGET copy_hdr)
add_dependencies(${PROJECT_NAME} copy_hdr)
endif()
# Include the tests configuration
if(ENABLE_TESTS)
include(${CMAKE_SOURCE_DIR}/tests/CMakeLists.tests.cmake)
endif()