lain-bootleg-bootleg icon indicating copy to clipboard operation
lain-bootleg-bootleg copied to clipboard

install & asset finding logic

Open OPNA2608 opened this issue 3 years ago • 0 comments

Currently there are no CMake install rules for the binary & assets, I think that would be a good addition.

For that, some more sophisticated logic for finding the assets at runtime would be needed, so Unixoid-style FHS (or Darwin-style bundles ig) can work without cding to some weird directories. For example

  1. Maybe search in a path passed via an envvar or switch first in case the normal mechanism needs to be overridden
  2. Then in $CWD/res so Windows-style packaging (exe in a dir, assets next to it) works as expected
  3. Then in a user-specific path (somewhere under $XDG_DATA_HOME maybe, related to #3)
  4. Then in a system path - CMake has a CMAKE_INSTALL_DATADIR / CMAKE_INSTALL_FULL_DATADIR for that sort of stuff when using GNUInstallDirs to specify install paths (dunno if it handles bundles on Darwin ottomh though) (or some other path configured at build-time)
  5. Also, some graceful error handling would help so missing assets don't lead to a SIGSEGV.

OPNA2608 avatar Jan 01 '22 01:01 OPNA2608