-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
103 lines (52 loc) · 1.41 KB
/
Copy pathCMakeLists.txt
File metadata and controls
103 lines (52 loc) · 1.41 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#root/CMakeLists.txt
cmake_minimum_required(VERSION 3.17)
project(TheEngine CXX C)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include(FetchContent)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
file(GLOB_RECURSE ENGINE_SOURCES
"src/*.cpp"
"src/*.h"
"src/*.hpp"
"include/*.h"
)
file(GLOB_RECURSE EXCLUDE_SOURCES
"src/rendering-system/api-backend/opengl/*"
"include/rendering-system/api-backend/opengl/*"
)
list(REMOVE_ITEM ENGINE_SOURCES ${EXCLUDE_SOURCES})
add_library(TheEngine STATIC
${ENGINE_SOURCES}
)
target_include_directories(TheEngine PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
add_subdirectory(external)
target_link_libraries(TheEngine PUBLIC
SDL3::SDL3-static
#SDL3::SDL3
glm::glm
common-lib
VulkanDeps
#OpenGLDeps
)
function(copy_runtime_deps target)
if(WIN32)
add_custom_command(
TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_RUNTIME_DLLS:${target}>"
"$<TARGET_FILE_DIR:${target}>"
COMMAND_EXPAND_LISTS
)
endif()
endfunction()
option(BUILD_TESTS "Enable Tests" OFF)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()