Page 1 of 1

Third party library

Posted: Thu Sep 03, 2020 2:53 pm
by Hack-Mike
Hello guys,

I need your help to add third part library to my project, the library is https://arduinojson.org.

I followed the instruction here https://arduinojson.org/v6/how-to/use-a ... ith-cmake/, but I'm not able to set CMake file correctly, is there somebody could help me with a tutorial ora some documentation to set CMake ?

thank you

Re: Third party library

Posted: Fri Sep 04, 2020 11:19 am
by ESP-Marius
Hi,

For how to integrate an external cmake library you can take a look at our build system guide: https://docs.espressif.com/projects/esp ... components

For ArduinoJson you could do something like this:

Code: Untitled.c Select all

idf_component_register(SRCS "hello_world_main.cpp"
INCLUDE_DIRS "")


# Path to the ArduinoJson source folder
add_subdirectory("../third-party/ArduinoJson" "ArduinoJson")

target_link_libraries(${COMPONENT_LIB} PUBLIC ArduinoJson)