glest / glest-source

Glest is a network multi-player cross-platform 3D real-time strategy (RTS) game, where you create armies of units and battle different factions.
https://glest.io
GNU General Public License v3.0
58 stars 40 forks source link

cmake doesn't fully account for the CUSTOM_DATA_INSTALL_PATH variable #110

Closed MirceaKitsune closed 6 years ago

MirceaKitsune commented 6 years ago

The configuration process doesn't properly determine the data directory on Linux. cmake will not fully account for the CUSTOM_DATA_INSTALL_PATH variable, and the resulting binary will still attempt to load some data from another location determined upon compile. For instance: If I set CUSTOM_DATA_INSTALL_PATH=/foo then compile, zetaglest will look for zetaglest-data under "/bar" regardless, although if it does find it there it will next complain about the data missing at "/foo".

In my case, since this is how I've had MegaGlest set up, I have zetaglest-data located at: /home/mircea/Games/Glest/ZetaGlest_GIT/data/glest_game Therefore my cmake configuration command is: cmake -DCUSTOM_DATA_INSTALL_PATH=/home/mircea/Games/Glest/ZetaGlest_GIT/data/glest_game /home/mircea/Games/Glest/ZetaGlest_GIT

After being compiled, zetaglest will complain that the data cannot be found, and reveal that it's expecting it at /home/mircea/Games/Glest/zetaglest-data for some odd reason:

Error msg = [File NOT FOUND, can't open file: [/home/mircea/Games/Glest/zetaglest-data/data/lang/english.lng]

If I rename and move zetaglest-data there however, it next complains that it can't find it at the path where I intended it to be altogether!

Error msg = [[#2] Could not open file [/home/mircea/Games/Glest/ZetaGlest_GIT/data/glest_game/data/core/menu/textures/logo.tga]

andy5995 commented 6 years ago

Please see related comments on https://github.com/ZetaGlest/zetaglest-source/pull/111#issuecomment-386437394

MirceaKitsune commented 6 years ago

Yes, there are also issues with the mk/linux/glest.ini file which itself specifies additional locations. The ultimate goal is to have a single data directory path rather than multiple ones, which is defined by the CUSTOM_DATA_INSTALL_PATH cmake variable.

andy5995 commented 6 years ago

Yes, there are also issues with the mk/linux/glest.ini file which itself specifies additional locations.

ticket for that is now at #113

andy5995 commented 6 years ago

This is mostly fixed now.

For instance: If I set CUSTOM_DATA_INSTALL_PATH=/foo then compile, zetaglest will look for zetaglest-data under "/bar" regardless, although if it does find it there it will next complain about the data missing at "/foo".

I didn't actually test using the method you describe, but that may work now. This is how I tested:

From the top zetaglest-source directory:

andy5995 commented 6 years ago

Oh, by the way, I replaced this option: CUSTOM_DATA_INSTALL_PATH=/foo

It's INSTALL_DIR_DATA now.