27 lines
650 B
CMake
27 lines
650 B
CMake
cmake_minimum_required(VERSION 3.24)
|
|
|
|
project(
|
|
Chectus
|
|
VERSION 0.1.0
|
|
DESCRIPTION "A chess engine that plays fun moves!"
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
include("cmake/third_party.cmake")
|
|
|
|
set(CHECTUS_SRC src/main.cpp)
|
|
|
|
add_executable(chectus_engine ${CHECTUS_SRC})
|
|
target_link_libraries(chectus_engine PRIVATE fmt simdjson "${TORCH_LIBRARIES}")
|
|
target_compile_features(chectus_engine PRIVATE cxx_std_20)
|
|
|
|
if (MSVC)
|
|
file(GLOB TORCH_DLLS "${TORCH_INSTALL_PREFIX}/lib/*.dll")
|
|
add_custom_command(
|
|
TARGET chectus_engine
|
|
POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
${TORCH_DLLS}
|
|
$<TARGET_FILE_DIR:chectus_engine>)
|
|
endif (MSVC)
|