Ogre Version

Problems building or running the engine, queries about how to use features etc.
Post Reply
libolt
Greenskin
Posts: 126
Joined: Wed Jan 19, 2005 4:48 am
x 9

Ogre Version

Post by libolt »

While I am moving my code to Ogre 1.11 I still need compatability with 1.10. Does ogre have a preprocessor macro that defines the version number?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5298
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1279
Contact:

Re: Ogre Version

Post by dark_sylinc »

See these macros in OgreMain/include/OgrePrerequisites.h

Code: Select all

#define OGRE_VERSION_MAJOR
#define OGRE_VERSION_MINOR
#define OGRE_VERSION_PATCH
#define OGRE_VERSION_SUFFIX
#define OGRE_VERSION_NAME
#define OGRE_VERSION
Cheers
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Ogre Version

Post by paroj »

Code: Select all

#if (OGRE_VERSION < ((1 << 16) | (11 << 8) | 0))
// 1.10
# else
// 1.11
#endif
probably we should also provide a OGRE_VERSION_LESS macro with ogre...
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12
Contact:

Re: Ogre Version

Post by mmixLinus »

As far as I understand, OGRE_VERSION_MAJOR, _MINOR and _PATCH are now (1.12) only available in OgreBuildSettings.h? Or at least removed from Prerequisites.h. Is this from 1.12.0 or already in 1.11.5?

Reason: I am fiddling with FindOgre.cmake in CEGUI v0-8.
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Ogre Version

Post by paroj »

you shouldnt have to:
https://bitbucket.org/cegui/cegui/commi ... f7e53163d4

but to answer your question, its in OgreBuildSettings.h since 1.11.5 already.
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12
Contact:

Re: Ogre Version

Post by mmixLinus »

The problem is that find_package(Ogre) fails because it greps Prerequisites.h, not OgreBuildSettings.h for the major, minor and patch. Anyway, thanks for your help. I'll try to submit a backward compatible fix (to cegui) : )
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: Ogre Version

Post by paroj »

with the linked patch, it should use find_package(OGRE) which does not grep anything, but uses the new cmake findconfig infrastructure.
Only if this fails it falls back to find_package(Ogre).

Maybe you are on a case insensitive FS and the above logic fails. Then the fix is to rename the FindOgre.cmake script to FindOldOgre.cmake and change the according line to find_package(OldOgre)
User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 12
Contact:

Re: Ogre Version

Post by mmixLinus »

the new cmake findconfig infrastructure
ah ok, I'll check this. Thanks : )
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
Post Reply