TBH, this question doesn't necessarily to SFML specifically, but to any program that requires a resource file.
Say I have a game, compiled into a program game.exe. Said game has a line in its code:
std::ifstream ifs{ "important_data.lua" };
Now obviously, in order for the game to work, this executable needs the resource file important_data.lua in the same directory as the executable. This is quite easy to manage on Windows and MacOSX, where applications are bundled so that they have a folder dedicated to their own applications. (C:\Program Files\program_name\... and on OSX executable/Contents/...). However, I don't understand how this works on Linux. Now obviously, the executable gets installed to /usr/local/bin or /usr/bin. Now where does the resource file go? Would it go to bin, where any other application in the directory has access to it, or somewhere else? I would think it would go /usr/share, but then the application wouldn't run because ifstream would be unable to access it. Where should this resource file be placed for my game?
If It's relevant, I'm using CMake to manage everything related to my game.
If you would run "make install", then the resources are placed in /usr/share/emptyepsilon/
If you only want to run an out-of-source build, then you would do it like this (I do this all the time):
mkdir _build
cd _build
cmake ..
make -j 5
cd ..
./_build/EmptyEpsilon
As my resourceprovider system looks in both the compiled prefixed path AND the current working directory, it can find the files due to the current working directory.