cmake_minimum_required( VERSION 3.22 )
project( snoop_device )

set( CMAKE_CXX_STANDARD 23 )

add_subdirectory( third_party/portaudio )
add_subdirectory( third_party/opus )
add_subdirectory( third_party/cpp-httplib )
add_subdirectory( third_party/nlohmann_json )
add_subdirectory( third_party/spdlog )
add_subdirectory( third_party/libogg )
add_subdirectory( third_party/socket.io-client-cpp )
add_subdirectory( third_party/libdatachannel )

option(USE_ALSA_ADAPTER "Use ALSA Adapter" OFF)
if(USE_ALSA_ADAPTER)
    message(STATUS "Using ALSA Adapter")
    add_definitions(-DUSE_ALSA_ADAPTER)
endif()

set( SOURCES
        src/main.cpp
)

set( HEADERS
        src/Concepts/AudioAdapterConcept.h
        src/Concepts/AudioEncderConcept.h
        src/Concepts/AudioWriterConcept.h
        src/AudioAdapters/PortAudioAdapter.h
        src/AudioAdapters/AlsaAudioAdapter.h
        src/AudioEncoders/OpusEncoder.h
        src/AudioWriters/OggAudioWriter.h
        src/Services/AudioStreamService.h
        src/Services/AudioWriterService.h
        src/Services/ConfigService.h
        src/Services/DeviceControlService.h
        src/Services/EnrollmentService.h
)

add_executable( ${PROJECT_NAME} ${SOURCES} ${HEADERS} )
target_include_directories( ${PROJECT_NAME} PRIVATE src )
target_link_libraries( ${PROJECT_NAME} PRIVATE portaudio_static opus sioclient_tls nlohmann_json spdlog::spdlog_header_only Ogg::ogg httplib::httplib )
