I'm new to ESP-IDF and Platformio.
I want to add my source files in CMakeLists.txt by folders, not one by one as files. This should be done by SRC_DIRS but it doesn't work for me. How can I get it done?
81 Answer
So I think I figured it out. In the docs
idf_component_register([[SRCS src1 src2 ...] | [[SRC_DIRS dir1 dir2 ...] [EXCLUDE_SRCS src1 src2 ...]]
notice the "OR" bar between SRCS and SRC_DIRS. This made me think that I can either use either SRCS or SRC_DIRS, but not both at the same time. So following works
idf_component_register(SRC_DIRS "." "uart")
Notice, however, as @Tarmo noticed, that you have to run reconfigure or clean build each time you add a new source.
