Components folder with multiple subfolders
Posted: Wed Sep 28, 2022 5:47 am
Hi, I would need to better structure my code by creating subfolders in the components folder. But no matter what I try I always get errors.
So far I have this structure working and compiling ocrrectly:
components
-component1
--component1.cpp
--component1.h
-component2
--component2.cpp
--component2.h
But now I would like to have something like this:
components
-lowlevel
--component1
---component1.cpp
---component1.h
--component2
---component2.cpp
---component2.h
-component3
--component3.cpp
--component3.h
I have trying changing the cmakelist.txt from:
to:
But the compiler doesn't find component1.cpp which is in the lowlevel folder inside components
Any idea?
So far I have this structure working and compiling ocrrectly:
components
-component1
--component1.cpp
--component1.h
-component2
--component2.cpp
--component2.h
But now I would like to have something like this:
components
-lowlevel
--component1
---component1.cpp
---component1.h
--component2
---component2.cpp
---component2.h
-component3
--component3.cpp
--component3.h
I have trying changing the cmakelist.txt from:
Code: Select all
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../../components")
Code: Select all
list(APPEND EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../../components/lowlevel" "${CMAKE_CURRENT_SOURCE_DIR}/../../../components")
Any idea?