2023-04-14 15:57:12 +02:00
|
|
|
# This project serves as a demo to enable using esp-mqtt on ESP platform targets as well as on linux
|
2023-03-31 18:25:41 +02:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
2023-06-22 19:37:23 +02:00
|
|
|
if("${IDF_TARGET}" STREQUAL "linux")
|
2023-04-14 15:57:12 +02:00
|
|
|
# For linux-target we have two options:
|
|
|
|
# - With lwIP (must be defined on command line, e.g. idf.py -DWITH_LWIP=1)
|
|
|
|
# access networking from linux `tap` interface (TAP networking mode)
|
|
|
|
# - Without lwIP (must be defined on command line, e.g. idf.py -DWITH_LWIP=0)
|
|
|
|
# no designated interface, accesses user network via linux/socket sys calls
|
2023-04-04 12:57:38 +02:00
|
|
|
if(WITH_LWIP STREQUAL 1)
|
|
|
|
set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_tapif_io
|
|
|
|
"../../common_components/linux_compat/esp_timer")
|
|
|
|
set(COMPONENTS main esp_netif lwip protocol_examples_tapif_io startup esp_hw_support esp_system nvs_flash mqtt esp_timer)
|
|
|
|
else()
|
|
|
|
list(APPEND EXTRA_COMPONENT_DIRS
|
|
|
|
"../../common_components/linux_compat/esp_timer"
|
|
|
|
"$ENV{IDF_PATH}/examples/protocols/linux_stubs/esp_stubs")
|
|
|
|
set(COMPONENTS main nvs_flash esp-tls esp_stubs mqtt protocol_examples_common esp_timer)
|
|
|
|
endif()
|
2023-03-31 18:25:41 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
2023-04-14 15:57:12 +02:00
|
|
|
project(esp_mqtt_demo)
|