Third party library

Hack-Mike
Posts: 8
Joined: Wed Jul 15, 2020 1:42 pm

Third party library

Postby Hack-Mike » Thu Sep 03, 2020 2:53 pm

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

ESP-Marius
Posts: 74
Joined: Wed Oct 23, 2019 1:49 am

Re: Third party library

Postby ESP-Marius » Fri Sep 04, 2020 11:19 am

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:
  1. idf_component_register(SRCS "hello_world_main.cpp"
  2.                     INCLUDE_DIRS "")
  3.  
  4.  
  5. # Path to the ArduinoJson source folder
  6. add_subdirectory("../third-party/ArduinoJson" "ArduinoJson")
  7.  
  8. target_link_libraries(${COMPONENT_LIB} PUBLIC ArduinoJson)

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Majestic-12 [Bot] and 312 guests