set(COMPONENT_SRCS "main.cpp")
set(COMPONENT_ADD_INCLUDEDIRS "../libs/main")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/cloud")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/code")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/compress")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/console")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/containers")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/core")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/crypt")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/geo")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/io_devices")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/io_utils")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/math")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/resources")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/system")
list(APPEND COMPONENT_ADD_INCLUDEDIRS "../libs/main/thread")
set(COMPONENT_PRIV_REQUIRES pthread lwip freertos vfs spi_flash libsodium)
register_component()
set(PIP_FREERTOS ON)
set(LIB OFF)
set(INCLUDE_DIRS ${IDF_INCLUDE_DIRECTORIES})
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/newlib/platform_include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/newlib/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/libsodium/libsodium/src/libsodium/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/libsodium/port_include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/heap/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/esp_rom/include/esp32)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/driver/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/spi_flash/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/spiffs/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/soc/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/soc/esp32/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/freertos/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/lwip/lwip/src/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/lwip/port/esp32/include)
list(APPEND INCLUDE_DIRS $ENV{IDF_PATH}/components/vfs/include)
include_directories(${INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/pip)
#message("IDF_COMPILE_DEFINITIONS = ${IDF_COMPILE_DEFINITIONS}")
#message("IDF_INCLUDE_DIRECTORIES = ${IDF_INCLUDE_DIRECTORIES}")
add_compile_options(${IDF_COMPILE_OPTIONS})
add_compile_options(${IDF_CXX_COMPILE_OPTIONS})
add_definitions(-DESP_PLATFORM)
add_definitions(-DGCC_NOT_5_2_0=0)
add_definitions(-DHAVE_CONFIG_H)
add_subdirectory(.. pip)
find_package(PIP REQUIRED)
target_link_libraries(${COMPONENT_TARGET} PIP::Crypt PIP::IOUtils PIP::Compress)
target_compile_definitions(${COMPONENT_TARGET} PRIVATE ESP_PLATFORM PIP_FREERTOS)
