Rosalie241 / RMG

Rosalie's Mupen GUI
GNU General Public License v3.0
568 stars 50 forks source link

RMG-Core: Fix GNUInstallDirs usage #226

Closed OPNA2608 closed 4 months ago

OPNA2608 commented 4 months ago

One may not manually prepend CMAKE_INSTALL_*DIR variables with CMAKE_INSTALL_PREFIX, because CMAKE_INSTALL_*DIR variables may already be absolute paths - inside or outside of CMAKE_INSTALL_PREFIX.

To get a guaranteed-absolute version of them, CMAKE_INSTALL_FULL_*DIR must be used.


Spotted in https://github.com/NixOS/nixpkgs/pull/284124#issuecomment-1913697312:

terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error' what():  filesystem error: recursive directory iterator cannot open directory: No such file or directory [/nix/store/zv4gsdpzdkpb3aynj3h9agk8wzzyrzj9-rmg-0.5.6//nix/store/zv4gsdpzdkpb3aynj3h9agk8wzzyrzj9-rmg-0.5.6/lib/RMG//Core] Aborted (core dumped)

I have left CORE_INSTALL_PREFIX incase you still need it somewhere in the future, though it will currently be unused.

Rosalie241 commented 4 months ago

Thank you for the patch, I apologize for the breakage and not reading the documentation correctly! There are always so many subtle things to watch out for :heart: