Kroniax_Cpp icon indicating copy to clipboard operation
Kroniax_Cpp copied to clipboard

Add support for a custom data dir for Linux system installs

Open akien-mga opened this issue 9 years ago • 2 comments

An optional KRONIAX_DATADIR parameter can be passed to CMake to initialise a custom data dir (e.g. /usr/share/games/kroniax for system-wide installs on Linux). If the optional parameter is not passed, the data dir defaults to "./data" as previously.

To achieve this, a Helper::getData function has been added in new global.hpp header, which can be accessed from any source file that requires access to data files.

Fixes #16.

akien-mga avatar Jul 05 '15 21:07 akien-mga

Note that I am a C++ newbie, so the way I implemented this feature might not be the best solution you could think of. Feel free to implement it your own way if you prefer, or give me feedback on what I could improve in this PR.

akien-mga avatar Jul 05 '15 21:07 akien-mga

Looks like I was a bit overly optimistic: my PR does allow to put the game data in a custom dir, but if the dir is read-only, only the tutorials can be loaded. I'll open another issue for that.

akien-mga avatar Jul 05 '15 22:07 akien-mga