cmake_minimum_required(VERSION 3.25)
project(community_czech_transformer LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)

if (NOT TARGET cognia_frontend)
    if (NOT COGNIA_SOURCE_DIR)
        message(FATAL_ERROR "Set COGNIA_SOURCE_DIR to a Cognia checkout")
    endif()
    set(COGNIA_FRONTEND_ONLY ON CACHE BOOL "Build portable Cognia API only" FORCE)
    set(COGNIA_BUILD_COMMUNITY_EXAMPLES OFF CACHE BOOL "Avoid nested bundled examples" FORCE)
    add_subdirectory(${COGNIA_SOURCE_DIR} cognia-runtime EXCLUDE_FROM_ALL)
endif()

add_executable(community_czech_transformer_train src/train.cpp)
target_include_directories(community_czech_transformer_train PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(community_czech_transformer_train PRIVATE cognia_frontend)

add_executable(community_czech_transformer_tokenizer src/tokenizer.cpp)
target_link_libraries(community_czech_transformer_tokenizer PRIVATE cognia_frontend)

# Backward-compatible build target only; inference belongs to the Cognia server.
add_custom_target(community_czech_transformer_generate)
