I am in the process of switching to Linux for development, and I am puzzled by how to maintain good FHS compliance in my programs.
For example, on Windows, I know that all resources (bitmaps, audio data, etc.) that my program will need can be found with relative paths from the executable, so the same thing if I run the program from my development directory or from the installation (for example, in the "Program Files" section), the program will be able to find all of its files.
Now, on Linux, I see that usually the executable goes under / usr / local / bin and its resources to / usr / local / share. (And the truth is that I'm not even sure about this)
For convenience (for example, version control), I would like to have all the files related to the project in one path, for example, project / src for the source and project / data for the resource files.
Is there any standard or recommended way that allows me to simply rebuild the binary for testing and use the files in the project / data directory, as well as the ability to find files when they are under / usr / local / share?
I thought, for example, to set a symbolic link in / usr / local / share, pointing to my dir resource, and then just hardcode that path inside my program, but I feel that it is pretty hacky and not very portable.
Also, I was thinking of starting a setup script that copies all resources to / usr / local / share every time I change or add resources, but I also feel that this is not a good way to do this.
Can someone tell me or point me where he says how this problem is usually resolved?
Thanks!