# queue_index - Modular structure
set(QUEUE_INDEX_SOURCES
    storage/index_storage.cpp
    heap/binary_heap.cpp
    index/priority_queue.cpp
    queue_index.cpp
)

add_library(queue_index SHARED ${QUEUE_INDEX_SOURCES})

target_include_directories(queue_index PUBLIC
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/storage
    ${CMAKE_CURRENT_SOURCE_DIR}/heap
    ${CMAKE_CURRENT_SOURCE_DIR}/index
)

target_include_directories(queue_index PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/../common/include
)

target_link_libraries(queue_index PRIVATE
    fetchml_common
    Threads::Threads
)

# Require C++20
target_compile_features(queue_index PUBLIC cxx_std_20)

# Set library properties
set_target_properties(queue_index PROPERTIES
    VERSION ${PROJECT_VERSION}
    SOVERSION ${PROJECT_VERSION_MAJOR}
    PUBLIC_HEADER "queue_index.h"
    LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/
    ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)

# Install
install(TARGETS queue_index
    LIBRARY DESTINATION lib
    ARCHIVE DESTINATION lib
    PUBLIC_HEADER DESTINATION include/fetchml
)
