multitarget build and include_guard(GLOBAL) question...

I am probably using it wrong (or not as intended).

I have libraries lib-A and lib-B which can be built for different ARM devices (M4, M7, etc.) CMakeLists.txt inside of lib-A and lib-B handles conditional building. Let’s say lib-B depends on lib-A.

If all projects are built for let’s say M4 then everything works as guard prevents lib-A from being added multiple times.

If I have several apps (like tests built for multiple targets) then app-Z-m4 is built fine but for app-Z-m7 lib-A (or lib-B) don’t add target include paths as CMakeLists.txt isn’t included (guarded).

my initial idea was to avoid folder per architecture and multiple CMakeLists.txt files. wanted to have just one per project.

is there a best practice around this kind of cases?