-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
96 lines (72 loc) · 2.4 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
cmake_minimum_required(VERSION 3.0)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(BUILD_TESTS "Build the Mojave tests" OFF)
option(BUILD_BENCHMARK "Build the Mojave benchmarks" OFF)
option(LOGGING "The engine provides debugging info" OFF)
enable_testing()
project(Mojave VERSION 1.0)
#include_directories(vcpkg_installed/*/include/)
if (DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -DDEBUG -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -OFast")
endif()
add_executable(
mojave
src/main.cpp
src/Bitboard.cpp
src/ChessboardSearch.cpp
src/BoardConcepts.cpp
src/Moves.cpp src/Chessboard.cpp
src/ChessboardEvaluation.cpp
src/Interface.cpp
src/ChessboardMoveGeneration.cpp
src/ChessboardZobrist.cpp
src/ChessboardBoardManipulation.cpp
src/ChessboardDisplay.cpp
src/ChessboardFen.cpp
src/InterfaceCLI.cpp
src/InterfaceUCI.cpp
)
add_library(bitboard STATIC src/Bitboard.cpp)
add_library(boardconcepts STATIC src/BoardConcepts.cpp)
add_library(moves STATIC src/Moves.cpp)
target_link_libraries(moves bitboard)
target_link_libraries(moves boardconcepts)
add_library(chessboard STATIC
src/Chessboard.cpp
src/ChessboardSearch.cpp
src/ChessboardEvaluation.cpp
src/ChessboardMoveGeneration.cpp
src/ChessboardZobrist.cpp
src/ChessboardBoardManipulation.cpp
src/ChessboardDisplay.cpp
src/ChessboardFen.cpp
)
target_link_libraries(chessboard bitboard)
target_link_libraries(chessboard boardconcepts)
target_link_libraries(chessboard moves)
if (DEBUG)
# GOOGLE LOGGING LIBRARY
find_package(glog REQUIRED)
target_link_libraries(mojave glog::glog)
# GOOGLES TESTING LIBRARY
find_package(GTest REQUIRED)
include(GoogleTest)
add_executable(tests
tests/unit_tests/main.cpp
tests/unit_tests/bitboard_test.cpp
tests/unit_tests/boardconcepts_test.cpp
tests/unit_tests/moves_test.cpp
tests/unit_tests/chessboard_test.cpp
)
target_link_libraries(tests GTest::gtest)
target_link_libraries(tests bitboard)
target_link_libraries(tests boardconcepts)
target_link_libraries(tests moves)
target_link_libraries(tests chessboard)
gtest_discover_tests(tests)
endif()