CLocatorAPI::setup_fs_path symlinking ignores CMAKE_INSTALL_DATAROOTDIR
Created by: OPNA2608
Describe the bug Introduced by https://github.com/OpenXRay/xray-16/pull/739, https://github.com/OpenXRay/xray-16/commit/c076c7a5780acdf1c95e5cb51982ff1ba7bb0d82: https://github.com/OpenXRay/xray-16/blob/c393d2d8530f8f6795852affc56b33d9a3d6dd61/src/xrCore/LocatorAPI.cpp#L873-L887
This assumes that fsgame.ltx
and gamedata/shaders/gl
are always installed to /usr/share/openxray
, which is not the case:
https://github.com/OpenXRay/xray-16/blob/83c0397f2b51e12f1507697c1f2a8e1095a62f5a/res/CMakeLists.txt#L3-L5
Building with a different CMAKE_INSTALL_PREFIX
or CMAKE_INSTALL_DATAROOTDIR
breaks this assumption and produces bogus symlinks.
To Reproduce Steps to reproduce the behavior:
- Build with
cmake -DCMAKE_INSTALL_PREFIX=/usr/local
and install - Run
xr_3da
in an environment where the pref path in the user's home doesn't exist - Observe that it produces bogus symlinks to
/usr/share/openxray
, while the files were actually installed to/usr/local/share/openxray
Expected behavior
The CMake script should make the value of CMAKE_INSTALL_FULL_DATAROOTDIR
available to this code via a define (either under this or a less CMake-specific name) and the symlinking calls should be
symlink(CMAKE_INSTALL_FULL_DATAROOTDIR "/openxray/...", tmp);
BugTrap error report n/a
Desktop (please complete the following information):
- OS: NixOS unstable
- OpenXRay build version 83c0397f
Additional context Should be replicable on any Linux system.