set(CARTRIDGE_VERSION_MAJOR 1)
set(CARTRIDGE_VERSION_MINOR 0)
set(CARTRIDGE_VERSION_PATCH 0)
set(CARTRIDGE_VERSION "${CARTRIDGE_VERSION_MAJOR}.${CARTRIDGE_VERSION_MINOR}.${CARTRIDGE_VERSION_PATCH}")

configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/include/cartridge/version.h
    @ONLY
)

set(CARTRIDGE_SRC
        src/binary_reader.cpp
        src/cartridge.cpp
        src/lat_lng.cpp
        src/media.cpp
        src/parser.cpp
)

add_library(cartridge SHARED ${CARTRIDGE_SRC})
set_target_properties(cartridge PROPERTIES
        VERSION ${CARTRIDGE_VERSION}
        SOVERSION ${CARTRIDGE_VERSION_MAJOR}
        CXX_STANDARD 23
        CXX_STANDARD_REQUIRED ON
)

target_include_directories(cartridge
        PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}/include
        ${CMAKE_CURRENT_BINARY_DIR}/include
)

target_link_libraries(cartridge
        PRIVATE
        storage
)
