-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
31 lines (22 loc) · 872 Bytes
/
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
cmake_minimum_required(VERSION 3.4...3.18)
project(ChessBot)
set(DEBUG 1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) # Turn on to ensure -std=c++17 and not -std=gnu++17
set(AI_LIB_NAME ChessEngine)
set(TESTS_NAME EngineTests)
set(EXTRA_DIR ${CMAKE_SOURCE_DIR}/extra)
#CHESSLIBRARY
add_subdirectory(engine/bin)
target_compile_definitions(${AI_LIB_NAME} PUBLIC DEBUG=${DEBUG})
#TESTING
add_subdirectory(engine/tests)
# links output directory, so python can use it
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/engine/output)
#PYTHON MODULES
set(WRAPPER_NAME CPPChessLib)
add_subdirectory(extra/pybind11)
pybind11_add_module(${WRAPPER_NAME} engine/bin/wrapper.cpp)
target_compile_definitions(${WRAPPER_NAME} PRIVATE WRAPPER_NAME=${WRAPPER_NAME})
TARGET_LINK_LIBRARIES(${WRAPPER_NAME} PUBLIC ${AI_LIB_NAME})