How would I go about easily managing an Arduino project that has multiple sketches(project/sketch_0/sketch_0.ino; project/sketch_1/sketch_1.ino; ecc.) for multiple boards with a unique configuration .h file in the project root directory?
I've already tried
fatal error: config_file.h: No such file or directory
#include "config_file.h"
^~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: config_file.h: No such file or directory```
Have you tried adding a folder in your Arduino Sketch folder under Libraries, create a folder there and put your header file in that folder and restart the Arduino IDE.
If your sharing the project with other people, just create one folder to upload & have two sub folders with the config file & project in separate folders, then put a read me file with instructions of folder location. Otherwise create your own library for your project.
It sounds like your making things more complicated then they need to be, I'm sorry but I don't have anymore suggestions.
The reason this doesn't work is because the sketch code is copied to a temporary build folder after it is converted to C++. The C++ compiler is compiling the code in that temporary build folder, so a relative path to a location outside the sketch folder in an #include directive won't work.
The user would set the Sketchbook location path in their preferences (accessed via File > Preferences in the Arduino IDE) to the root folder of the project. This will cause the IDE to be able to find config_file.h when the sketches contain an #include directive like this:
I'm doing this right now with an Mega328 PLC board and an ESP32 5" display as an HMI for the PLC. The solution I chose is VS Code with platformIO. I create a workspace with two project, one for each board.