cmake_minimum_required(VERSION 3.26)
project(Breeze C)

set(CMAKE_C_STANDARD 11)

set(BUILD_EXAMPLES false)
add_subdirectory(libs/raylib-4.5.0)

set(librarySources
    libs/cute_tiled.c
    libs/flecs/flecs.c
)

set(libraryDirs
    libs/cute_tiled
    libs/flecs
)


set(BreezeSources
        breeze/core/logger.c
        breeze/core/module_system.c

        breeze/utils/tokenizer.c
    )

set(BreezeHeaders
        breeze/core/logger.h

        breeze/math/vec2i.h

        breeze/utils/tokenizer.h

        breeze/defines.h
        breeze/game.h

        breeze.h
    )

set(BreezeInternalHeaders
        breeze/core/logger_module.h
        breeze/core/module_system.h
)

add_library(Breeze STATIC
        ${BreezeSources}
        ${BreezeInternalHeaders}
        ${BreezeHeaders}
        ${librarySources}
)

set_target_properties(Breeze PROPERTIES
                      PUBLIC_HEADER "${BreezeHeaders}")

target_link_libraries(Breeze raylib)

#target_include_directories(Breeze PUBLIC .)
target_include_directories(Breeze
        PUBLIC
        $<INSTALL_INTERFACE:include>
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
        ${libraryDirs})

file(COPY ${BreezeHeaders} DESTINATION "include")

if (${BUILD_BREEZE_TESTS})
    MESSAGE(STATUS "Building breeze tests is enabled")
    add_subdirectory(tests)
endif()

