CMake - Nested component
Posted: Fri Jan 24, 2020 11:32 am
How do I nest a component within a component, is it possible?
For example:
Where main, src1.c, requires component1a.
I was hoping I could do set(EXTRA_COMPONENT_DIRS component1a) in the CMakeLists.txt of component1, and then in the CMakeLists.txt for main REQUIRES component1a but I get the error Failed to resolve component 'component1a'.
I am trying to avoid having to do set(EXTRA_COMPONENT_DIRS component1/component1a) in the main CMakeLists.txt.
Thanks
For example:
Code: Select all
- myProject/
- CMakeLists.txt
- sdkconfig
- components/ - component1/ - CMakeLists.txt
- src1.c
- component1a/ - CMakeLists.txt
- src1.c
- component2/ - CMakeLists.txt
- src1.c
- include/ - component2.h
- main/ - src1.c
- src2.c
- build/
I was hoping I could do set(EXTRA_COMPONENT_DIRS component1a) in the CMakeLists.txt of component1, and then in the CMakeLists.txt for main REQUIRES component1a but I get the error Failed to resolve component 'component1a'.
I am trying to avoid having to do set(EXTRA_COMPONENT_DIRS component1/component1a) in the main CMakeLists.txt.
Thanks