Finding 'automagically' resource installation paths?

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

wondersye
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Sun May 22, 2011 16:04

Finding 'automagically' resource installation paths?

Postby wondersye » Fri Jun 17, 2011 12:26

Hi,

I am not sure it is fully relevant, but an issue for me was to tell the CEGUI library where to find the various resources it relies on (ex: 'defaultResProvider.setResourceGroupDirectory("schemes",..' etc. for imagesets, fonts, layouts, etc.).

As the library I am integrating CEGUI into, like the CEGUI itself, can be installed in a user-specified location, I had to tell the integrating library what CEGUI's base path was to be used for resources (either as a configure-generated symbol in a file, or thanks to the -D preprocessor option and some macro hack to protect this path).

I did it but it was not very straightforward; I was wondering if something simpler/cleaner could be done.

I was thinking that a function like const std::string & CEGUI::GetDefaultInstallBaseResourceDirectory() would be ideal from the users' point of view (it would for example return "/home/joe/my-CEGUI-0.7.5-install/share/CEGUI"). It could be possible to implement, provided one does not override the install target (specified at configure-time) once CEGUI has been built.

Another option would be to generate a config script that would set all compile and link settings for the users, a bit like SDL does it:

Code: Select all

> bin/sdl-config --cflags                                                                                       
-I/home/joe/Projects/SDL-1.2.14/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT

> bin/sdl-config --libs                                                                                         
-L/home/joe/Projects/SDL-1.2.14/lib -lSDL -lpthread                           
 


CEGUI's counterpart could then add a -DCEGUI_RSC_PATH="/home/joe/Projects/CEGUI-0.7.5/share/CEGUI" for example.

Would it make sense? Is there any better solution for that resource path issue?

Thanks in advance for any hint,

Olivier Boudeville.

User avatar
evilBeaver
Just popping in
Just popping in
Posts: 5
Joined: Wed Jun 08, 2011 23:56

Re: Finding 'automagically' resource installation paths?

Postby evilBeaver » Fri Jun 17, 2011 14:10

the resourceGroups are not part of a library, u have to set them manually

you should look at this tutorial:

[url]
http://www.cegui.org.uk/wiki/index.php/ ... rce_Groups[/url]

you should put everything you need in to a sub directory of your Project's directory and then use relativ Path names, so it can be found after installation.

some example shemes, layouts etc can be found in the datafiles directory.

I hope this helps

I don't think that a default path make seens cause Users want to put their files where they need them and ship them with their applkication

wondersye
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Sun May 22, 2011 16:04

Re: Finding 'automagically' resource installation paths?

Postby wondersye » Fri Jun 17, 2011 19:16

Hi,

Yes, one could copy locally datafiles and refer to them with relative paths. I thought that pointing directly to installed CEGUI's built-in ones (ex: for the Taharez look) could be cleaner (no duplication among user's data, and a single version can be shared between all CEGUI-using apps) and safer (w.r.t. licensing, but apparently this is a non-issue in most cases), but indeed there is little interest in that. It all boils down to considering whether this data is part of CEGUI or not!

And anyway, later, I will consider reading this data not directly from the filesystem, but from an abstract one (PhysicsFS), unless it raises too much difficulties. Time will tell!

Thanks for your answer,

Olivier.


Return to “Bug Reports, Suggestions, Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest