So far, I configured cmake to copy assets files into relative folders
Code: Select all
games/wizardry/datafile
games/wizardry/adventure
Code: Select all
/usr/local/games/wizardry/datafile
/usr/local/games/wizardry/adventure
Code: Select all
/usr/local/games/wizardry
Now the problems is that I cannot execute the game from anywhere in the system.
1. I first tried to put wizardry into /usr/local/bin, but it ends up not finding the assets
2. Then I tried create a symbolic link. I could not make cmake create the link, but even if I create the link manually, I end up not being in the right working directory and it does not find the assets.
3. I tried making a script that opens a sub shell, change folder and execute the program. But I cannot do it with relative path. And since I don't know where the user will have the software installed, I cannot use absolute path.
Other solutions: I could add /usr/local/games/wizardry to the system PATH variable from the cmake script
But then even if I do succeed, local configuration files created in the root folder once the game starts will not be created unless the game is executed as sudo.
-------------------------------------------------------------------------------------------
So now I am wondering If I should change the path inside my program instead. I would need to branch with precompiler directive if the OS is linux, to change all the path used in the game.
User config will be in $HOME
Binary will be in ???/bin
while assets will be in ???/games/wizardry
Where ??? should be /usr/local, but that is variable from a system to another, because the user can change the installation path when running cmake. Which adds another complication of how to find where the user installed the files within my program. Unless the CMAKE script creates a path variable and pass it into the compilation process, so that I can use absolute path.
It's hard to find information on installation standard or the recommended practice to use when installing software.
So is there another solution to install the software, or should I simply recode my paths to be more unix friendly?