recursively adding all source files in components directory using cmake setup ( esp-idf stable 4.0 )
Posted: Tue Mar 17, 2020 10:14 am
Hello,
I am having too many recursive folders in my project and all are in components directory. In new stable 4.0 I am trying to make the CMakeLists.txt is too confusing and I am not used to cmake based build.
Could someone create an example for a CMakeLists.txt for recursive folder?
Say I have components and main folder. Inside components I have lcd folder, but no source only headers inside. Inside lcd I have drv, gui_lib etc and all are having c and h files. Inside gui_lib I have further deep directories which is having more source code. I am a bit confused how to make CMakeLists.txt for each one and what ever I do, it is always showing undefined reference a lot, seems like I am not doing it properly.
Is any way to tell the root level CMakeLists.txt to recursively add all *.c and all folders and include folders ? This way I don't want to do CMakeLists.txt inside each folder which is an overhead for me and at present not working also coz I am not sure how to do it properly.
I am having too many recursive folders in my project and all are in components directory. In new stable 4.0 I am trying to make the CMakeLists.txt is too confusing and I am not used to cmake based build.
Could someone create an example for a CMakeLists.txt for recursive folder?
Say I have components and main folder. Inside components I have lcd folder, but no source only headers inside. Inside lcd I have drv, gui_lib etc and all are having c and h files. Inside gui_lib I have further deep directories which is having more source code. I am a bit confused how to make CMakeLists.txt for each one and what ever I do, it is always showing undefined reference a lot, seems like I am not doing it properly.
Is any way to tell the root level CMakeLists.txt to recursively add all *.c and all folders and include folders ? This way I don't want to do CMakeLists.txt inside each folder which is an overhead for me and at present not working also coz I am not sure how to do it properly.