blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.81k stars 1.38k forks source link

Using blynk-library as esp-idf component #585

Closed shecker closed 10 months ago

shecker commented 1 year ago

Hello,

I would like to use the blynk-library as a component in the esp-idf framework. I also use the arduino-esp32 component for Arduino compatibility. However, I am unable to link the blynk-library properly when using esp-idf are there any instructions on how to setup the CMakeList.txt file for the blynk-library?

Currently my CMakeList looks like this:


file(GLOB utility ${CMAKE_CURRENT_SOURCE_DIR}/../components/blynk-library/src/utility/*.cpp)
idf_component_register(SRCS ${utility} 
                    INCLUDE_DIRS "src" "src/utility"  "src/certs"  "src/Blynk"  "src/Adapters")

Thanks!

vshymanskyy commented 10 months ago

This should work:

cmake_minimum_required(VERSION 3.3)

file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.c")

idf_component_register(SRCS ${SOURCES}
                       INCLUDE_DIRS "src"
                       REQUIRES arduino)