cmake_minimum_required(VERSION 3.10)
project(ochess VERSION "0.0.0")

# wxWidgets
find_package(wxWidgets COMPONENTS net gl core base adv aui propgrid REQUIRED)
include(${wxWidgets_USE_FILE})

# Ochess
include_directories(src)
file(GLOB_RECURSE CPP_FILES src/*.cpp)
add_executable(ochess ${CPP_FILES})
target_link_libraries(ochess ${wxWidgets_LIBRARIES})

# chessarbiter
add_subdirectory(libs/chessarbiter)
target_link_libraries(ochess chessarbiter)
include_directories(${CHESSARBITER_INCLUDE_DIR})

# CGEditor
add_subdirectory(libs/cgeditor)
target_link_libraries(ochess cgeditor)
include_directories(${CGEDITOR_INCLUDE_DIR})

# pgnp
add_subdirectory(libs/pgnp)
target_link_libraries(ochess pgnp)
include_directories(${PGNP_INCLUDE_DIR})

#uciadapter
add_subdirectory(libs/uciadapter)
target_link_libraries(ochess uciadapter)
include_directories(${UCIADAPTER_INCLUDE_DIR})

# Assets
add_custom_command(TARGET ochess PRE_BUILD
                   COMMAND ${CMAKE_COMMAND} -E copy_directory
                   ${CMAKE_SOURCE_DIR}/tools/assets ${CMAKE_BINARY_DIR}/assets)
