How to detect if CEGUI was build with Xerces

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
FluXy
Just popping in
Just popping in
Posts: 14
Joined: Mon Aug 22, 2005 03:34
Location: Germany
Contact:

How to detect if CEGUI was build with Xerces

Postby FluXy » Sat Dec 02, 2006 07:22

I need to detect if CEGUI was build with Xerces to set the xsd directory but the only method i found was with using

Code: Select all

#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif


Is that the proper way :?:

Because we also use a #ifdef HAVE_CONFIG_H in Secret Maryo Chronicles for Linux builds. I think that would conflict ?

Regards,
Florian Richter

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Sat Dec 02, 2006 11:46

I would say:

Code: Select all

#include <CEGUIDirectory/config.h>
#ifdef CEGUI_WITH_XERCES
    /* Blabla */
#endif


right now i'm on my windows machine where i compiled CEGUI using VS 2005 and that works. I think on linux that file will also be created, so no need for HAVE_CONFIG_H (I think). For mac, I don't know :?

User avatar
FluXy
Just popping in
Just popping in
Posts: 14
Joined: Mon Aug 22, 2005 03:34
Location: Germany
Contact:

Postby FluXy » Sat Dec 02, 2006 18:12

#include <CEGUIDirectory/config.h>


I need it portable for Linux and Windows so everyone can compile the source without changing paths.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Sun Dec 03, 2006 23:07

that's what i meant.
commonly, you already added the CEGUi include path to your include paths right ? You can simply include config.h, because AFAIK, it is created on windows too :wink: at least, it's the case for me

User avatar
FluXy
Just popping in
Just popping in
Posts: 14
Joined: Mon Aug 22, 2005 03:34
Location: Germany
Contact:

Postby FluXy » Mon Dec 04, 2006 12:57

you already added the CEGUi include path to your include paths right ?


Yep but our game also seems to use a config.h on Linux.
So we would end up with 2 config.h files.

Problem is i have no Linux installed so i can't test if it would work.
Maybe we don't need our config.h include anymore so we can use the CEGUI one but the question remains if it's portable :?

The link to the post in the SMC Forums.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Thu Dec 07, 2006 12:41

FluXy wrote:
you already added the CEGUi include path to your include paths right ?


Yep but our game also seems to use a config.h on Linux.
So we would end up with 2 config.h files.

eh didn't think of that ! but i think it sould work if, let's assume:
/usr/include/CEGUI is the cegui include dir.
/usr/include is in the incude path
so if in your code you do:

Code: Select all

#include <CEGUI/config.h>

Not sure if that works, I didn't test it, but it should, as long as you don't have a directory named CEGUI in your game's directory. And i am not sure anymore if "make install" also copies the config.h file into /usr/include/CEGUI, but IIRC it does.

Hope that helps :)

User avatar
FluXy
Just popping in
Just popping in
Posts: 14
Joined: Mon Aug 22, 2005 03:34
Location: Germany
Contact:

Postby FluXy » Sun Dec 10, 2006 21:13

Thanks for your help Pompei2 :!:

nyhm our Gentoo Maintainer told me CEGUI doesn't install its config.h so we do now have the xsd files at both locations ( application and gui data directories )


I think the best way to find out at compilation what compiler is used should be over CEGUIconfig.h and not config.h.
The defines should be there :?

Is this a bug or feature request :?:

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Tue Dec 19, 2006 15:50

Why not try to load it and check for exception if not available ?


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: Google [Bot] and 9 guests