Hello Knitter,
Knitter {l Wrote}:I made some progress thanks to Auria and am now facing a problem where I can't tell the executable inside the bundle where the "data" folder is located. How does the code search for resources? The bundle structure places all assets in "Resources/data", this path can be expressed as a relative path to the executable like "../Resources/data" but I find no way to let the executable now of this.
The data folder path for system wide installations is handled by CMake.
By using the -DCMAKE_INSTALL_PREFIX the path can be set with a given prefix:
- {l Code}: {l Select All Code}
cmake -DCMAKE_INSTALL_PREFIX=/usr/ .
CMake will create a config.h file which will contain the configured data path:
$CMAKE_INSTALL_PREFIX+share/meandmyshadow/data/So I'm not sure what the structure is on MacOS X but whatever folder is chosen it will postfix
share/meandmyshadow/data/ to it.
Because this code is only used for Linux it didn't really cause any problems, but I think it's important to make this piece work for every platform.
Knitter {l Wrote}:I'm not really a the C++ developer but I don't think that code is correctly taking into account the fact that there is no /proc on OS X. Before finding that code I was confused to why the getAppPath method would return garbage (uninitialized string pointer). Granted I would never think of using /proc to determine an executable's name and I don't really know at what I'm looking at but isn't that a bug?
I haven't written this code but AFAIK it works on most Linux boxes.
But it's no good on non-Windows systems that don't have a /proc.
I'm not even sure wherefor the appPath and EXEName is needed?
Perhaps we can remove this code?