cmake_minimum_required(VERSION 3.25)

file(READ "VERSION.txt" RAW_VERSION)
string(STRIP "${RAW_VERSION}" APP_VERSION)

project(ITCH LANGUAGES CXX VERSION ${APP_VERSION})

include(${CMAKE_SOURCE_DIR}/cmake/Helpers.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/Versions.cmake)

if(${PROJECT_NAME}_ADD_COVERAGE_ANALYSIS)
    add_coverage_analysis()
endif()
if(${PROJECT_NAME}_APPLY_FORMATING)
    apply_formatting(${PROJECT_NAME}_USE_PER_FILE_FORMATTING)
endif()
if(${PROJECT_NAME}_APPLY_CLANG_TIDY_GLOBALY)
    apply_clang_tidy_globally()
endif()
if(${PROJECT_NAME}_BUILD_DOCUMENTATION)
    build_documentation()
endif()
if(${PROJECT_NAME}_ENABLE_ADDRESS_SANITIZER)
    enable_address_sanitizer()
endif()

add_subdirectory(src)

if (${PROJECT_NAME}_BUILD_TESTS)
    enable_testing()
    add_subdirectory(tests)
endif()
if (${PROJECT_NAME}_BUILD_BENCHMARKS)
    add_subdirectory(benchmarks)
endif()
if (${PROJECT_NAME}_BUILD_EXAMPLES)
    add_subdirectory(examples)
endif()
if (${PROJECT_NAME}_BUILD_FUZZERS)
    add_subdirectory(fuzz)
endif()
if (${PROJECT_NAME}_BUILD_TOOLS)
    add_subdirectory(tools/itch_tool)
endif()
if (${PROJECT_NAME}_BUILD_PYTHON)
    add_subdirectory(python)
endif()


