set(RECON_SRCS "")

if(CONFIG_RECON_MODE_CAMERA)
    list(APPEND RECON_SRCS "mod_cam.c")
endif()

if(CONFIG_RECON_MODE_MLAT)
    list(APPEND RECON_SRCS "mod_mlat.c")
endif()

# mod_trilat.c: legacy BLE trilateration (requires full BT stack)
# Uncomment if needed with CONFIG_BT_ENABLED=y
# list(APPEND RECON_SRCS "mod_trilat.c")

if(NOT RECON_SRCS)
    # No active recon sub-modules — register as header-only component
    idf_component_register(
        INCLUDE_DIRS "."
    )
else()
    set(RECON_REQUIRES core esp_wifi nvs_flash)

    if(CONFIG_RECON_MODE_CAMERA)
        list(APPEND RECON_REQUIRES esp_http_client espressif__esp32-camera)
    endif()

    if(CONFIG_RECON_MODE_MLAT)
        list(APPEND RECON_REQUIRES esp_timer)
    endif()

    idf_component_register(
        SRCS ${RECON_SRCS}
        INCLUDE_DIRS "."
        REQUIRES ${RECON_REQUIRES}
    )
endif()
