-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
74 lines (56 loc) · 1.57 KB
/
CMakeLists.txt
File metadata and controls
74 lines (56 loc) · 1.57 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
cmake_minimum_required(VERSION 3.14)
project(othello_bot)
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
enable_testing()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE Debug)
add_library(othello_core STATIC
src/core/move.cpp
src/core/board.cpp
src/core/transposition.cpp
)
target_include_directories(othello_core PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/core
)
add_library(othello_engine SHARED
src/engine/search.cpp
src/engine/engine.cpp
src/engine/eval.cpp
src/interface.cpp
)
target_include_directories(othello_engine PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/engine
)
target_link_libraries(othello_engine PUBLIC othello_core)
add_executable(othello_bot
src/main.cpp
)
target_link_libraries(othello_bot PRIVATE othello_engine)
# --- GoogleTest via FetchContent ---
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_executable(tests
tests/board_test.cpp
tests/eval_test.cpp
tests/perft_test.cpp
tests/transposition_test.cpp
)
target_link_libraries(tests
gtest_main
othello_engine
)
target_include_directories(tests PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/core
${CMAKE_CURRENT_SOURCE_DIR}/src/engine
)
include(GoogleTest)
gtest_discover_tests(tests)