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

if(NOT TARGET cognia_orchestration)
    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 runtime" FORCE)
    set(COGNIA_BUILD_COMMUNITY_EXAMPLES OFF CACHE BOOL "Avoid nested examples" FORCE)
    add_subdirectory(${COGNIA_SOURCE_DIR} cognia-runtime EXCLUDE_FROM_ALL)
endif()

add_executable(cognia_composite_three_engine src/main.cpp)
target_link_libraries(cognia_composite_three_engine PRIVATE
        cognia_orchestration cognia_frontend cognia_transformer_memory cognia_dpsh)
add_executable(cognia_composite_monitor src/monitor.cpp)
target_compile_definitions(cognia_composite_monitor PRIVATE
        COGNIA_MONITORING_WEB_ROOT="${CMAKE_SOURCE_DIR}/Core/Monitoring/web")
target_link_libraries(cognia_composite_monitor PRIVATE
        cognia_orchestration cognia_frontend cognia_transformer_memory
        cognia_dpsh cognia_monitoring ws2_32)
add_executable(cognia_composite_deploy src/deployment.cpp)
target_link_libraries(cognia_composite_deploy PRIVATE cognia_placement)
add_executable(cognia_composite_memory_context src/memory_context.cpp)
target_link_libraries(cognia_composite_memory_context PRIVATE cognia_transformer_memory)
