SFML community forums

Help => General => Topic started by: TheSpaceEvader on July 06, 2018, 05:14:31 pm

Title: How to build a project that relies on relative paths
Post by: TheSpaceEvader on July 06, 2018, 05:14:31 pm
So I recently made a post asking why, when I built my project using CMake, none of my resources (images, sounds, fonts etc) were loading: https://en.sfml-dev.org/forums/index.php?topic=24218.msg163942 (https://en.sfml-dev.org/forums/index.php?topic=24218.msg163942)
I now know, as eXpl0it3r rightfully pointed out, that the cause of my problem was due to my over-reliance on relative files and how, once the project is built, this is meaningless to the built program when executed. It's my understanding that there (atleast) two solutions to this for me:
So, my question is, which of these, or perhaps another, solution is most often used/considered best practice by the community? #1 seems like the more portable solution but does not seem to allow for regular image sizes?