How to add new folder to build?

No that’s the wrong way, include_dir etc. is the include folder (a single one) for the project, by default, include/.

With the above folder structure you have, the folder gui/ gets added to the include path, and so if you want to include Bar.h, you have to do it via #include <custom/Bar.h>. Of course, in this case you would just use a library.json file in the gui folder to automatically add custom and generated to the include path.

Your question is very similiar to Include Path Problems.