cmake_minimum_required(VERSION 3.16)
project(GANPI VERSION 1.0.0)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Include directories
include_directories(include)

# Source files - use simple version for Windows
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.c")

# Replace gemini_client.cpp with simple version on Windows
if(WIN32)
    list(REMOVE_ITEM SOURCES "src/gemini_client.cpp")
    list(APPEND SOURCES "src/gemini_client_simple.cpp")
endif()

# Create executable
add_executable(ganpi ${SOURCES})

# Compiler flags
if(MSVC)
    target_compile_options(ganpi PRIVATE /W4)
else()
    target_compile_options(ganpi PRIVATE -Wall -Wextra -Wpedantic)
endif()

# Install target
install(TARGETS ganpi DESTINATION bin)
