Page 1 of 1

How to detect if CEGUI was build with Xerces

Posted: Sat Dec 02, 2006 07:22
by FluXy
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

Posted: Sat Dec 02, 2006 11:46
by Pompei2
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 :?

Posted: Sat Dec 02, 2006 18:12
by FluXy
#include <CEGUIDirectory/config.h>


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

Posted: Sun Dec 03, 2006 23:07
by Pompei2
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

Posted: Mon Dec 04, 2006 12:57
by FluXy
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.

Posted: Thu Dec 07, 2006 12:41
by Pompei2
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 :)

Posted: Sun Dec 10, 2006 21:13
by FluXy
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 :?:

Posted: Tue Dec 19, 2006 15:50
by Dalfy
Why not try to load it and check for exception if not available ?