-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
80 lines (69 loc) · 2.2 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.23)
project(Marlin)
set(CMAKE_CXX_STANDARD 23)
add_subdirectory(Google_test src)
# defines group of source files
file(GLOB engine_SOURCES
"src/engine/*.h"
"src/engine/*.cpp"
)
file(GLOB gtest_SOURCES
"Google_test/*.h"
"Google_test/*.cpp"
)
file(GLOB server_SOURCES
"src/server/*.h"
"src/server/*.cpp"
)
# defines main build configuration
add_executable(Marlin main.cpp ${engine_SOURCES})
# include directories
include_directories(src)
include_directories(src/engine)
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
# defines test build configuration linking gtest with engine
# 'Google_Tests_run' is the target name
# 'test1.cpp tests2.cpp' are source files with tests
add_executable(Google_Tests_run
${engine_SOURCES}
${gtest_SOURCES}
)
target_link_libraries(Google_Tests_run gtest gtest_main)
# defines testers configuration for human vs human
add_executable(HvH_tester
${engine_SOURCES}
src/testers/hvh_main.cpp
src/testers/console_hvh_tester.cpp
src/testers/console_hvh_tester.h
src/testers/tester_utility.cpp
src/testers/tester_utility.h
)
# defines testers configuration for human vs computer
add_executable(HvC_tester
${engine_SOURCES}
src/testers/hvc_main.cpp
src/testers/console_hvc_tester.cpp
src/testers/console_hvc_tester.h
src/testers/tester_utility.cpp
src/testers/tester_utility.h
)
# defines testers configuration for computer vs computer
add_executable(CvC_tester
${engine_SOURCES}
src/testers/cvc_main.cpp
src/testers/console_cvc_tester.cpp
src/testers/console_cvc_tester.h
src/testers/tester_utility.cpp
src/testers/tester_utility.h
)
# defines configuration for server
add_executable(server
${engine_SOURCES}
${server_SOURCES}
)
target_link_libraries(server PRIVATE ws2_32 -static-libgcc -static-libstdc++ -static)
# defines server test configuration
add_executable(server_test
src/testers/server_tester_main.cpp
)
target_link_libraries(server_test PRIVATE ws2_32)