-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
54 lines (48 loc) · 1.32 KB
/
CMakeLists.txt
File metadata and controls
54 lines (48 loc) · 1.32 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
cmake_minimum_required(VERSION 3.24)
project(soup)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_definitions(DEBUG)
message("Built in debugging mode.")
endif()
# .:: Libraries ::.
add_subdirectory(libs/sfml)
add_subdirectory(libs/catch2)
add_subdirectory(src/engine)
# .:: Setup game tests ::.
file(GLOB_RECURSE tests "src/game/tests/*.cpp")
add_executable(gametests ${tests})
target_link_libraries(gametests PUBLIC
Catch2::Catch2WithMain
sfml-graphics
sfml-window
sfml-system
)
# .:: Setup main ::.
file(GLOB_RECURSE src "src/*.cpp" "src/*.hpp")
add_executable(game ${src})
target_link_libraries(game PUBLIC
Catch2::Catch2WithMain
sfml-graphics
sfml-window
sfml-system
engine
)
# .:: Copying DLL ::.
add_custom_command(TARGET game POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:Catch2::Catch2>"
"$<TARGET_FILE:Catch2::Catch2WithMain>"
"$<TARGET_FILE:sfml-system>"
"$<TARGET_FILE:sfml-window>"
"$<TARGET_FILE:sfml-graphics>"
$<TARGET_FILE_DIR:game>
)
add_custom_command(TARGET gametests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<TARGET_FILE:Catch2::Catch2>"
"$<TARGET_FILE:Catch2::Catch2WithMain>"
"$<TARGET_FILE:sfml-system>"
"$<TARGET_FILE:sfml-window>"
"$<TARGET_FILE:sfml-graphics>"
$<TARGET_FILE_DIR:gametests>
)