I'm trying to be familiar with ESP32. I'm following the program guide and I read the build system guide but I'm not able to understand how I can create a reusable components library between more than one project and I need some help....
I try to explain better what I did:
I created an easy project with main.c and I created under a completely different directory a commoncomponents folder.
Inside commoncomponents I created mycomponent where I put mycomponent.c and mycomponent.h. I also add CMakeLists.txt containing
Code: Select all
idf_component_register(SRCS "mycomponent.c"
INCLUDE_DIRS ".")
Code: Select all
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS "D:/commoncomponents/mycomponent")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(app-template)
Code: Select all
#include "mycomponent.h"
Code: Select all
MakeFiles/__idf_main.dir/main.c.obj -c ../main/main.c
../main/main.c:2:10: fatal error: mycomponent.h: No such file or directory
#include "mycomponent.h"
Thank you!