Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-DDATADIR has no effect #1391

Open
mcz opened this issue Oct 15, 2022 · 0 comments · May be fixed by #1392
Open

-DDATADIR has no effect #1391

mcz opened this issue Oct 15, 2022 · 0 comments · May be fixed by #1392

Comments

@mcz
Copy link

mcz commented Oct 15, 2022

What I would expect to happen:

Data files get installed to ${CMAKE_INSTALL_FULL_DATADIR}/openxcom
The game searches the following locations for data files:

  • $XDG_DATA_HOME/openxcom (if $XDG_DATA_HOME is set)
  • $HOME/.local/share/openxcom (if $XDG_DATA_HOME isn't set)
  • ${DATADIR}
  • $XDG_DATA_DIRS/openxcom (if $XDG_DATA_DIRS is set)
  • usr{,/local}/share/openxcom (if $XDG_DATA_DIRS isn't set)
  • ${CMAKE_INSTALL_FULL_DATADIR}/openxcom
  • ./

What actually happens:

Data files get installed to ${CMAKE_INSTALL_FULL_DATADIR}/openxcom
The game searches the following locations for data files:

  • $XDG_DATA_HOME/openxcom (if $XDG_DATA_HOME is set)
  • $HOME/.local/share/openxcom (if $XDG_DATA_HOME isn't set)
  • $XDG_DATA_DIRS/openxcom (if $XDG_DATA_DIRS is set)
  • usr{,/local}/share/openxcom (independently of $XDG_DATA_DIRS)
  • ${CMAKE_INSTALL_FULL_DATADIR}/openxcom
  • ./

The two commits responsible are #474 which added ${DATADIR} and also put usr{,/local}/share/openxcom on the directory list independently of the state of $XDG_DATA_DIRS, and #1057, which then replaced ${DATADIR} ${CMAKE_INSTALL_FULL_DATADIR}/openxcom causing ${DATADIR} to go unused.

I should also mention that while the desription of ${DATADIR} is wrong, so was my understanding of it. It is described as "Where to place datafiles", while I thought it meant "Where to look for datafiles".

($VAR means run-time environment variable, ${VAR} means build-time CMake variable)

@mcz mcz linked a pull request Oct 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant