Ogre Version

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

Ogre Version

Post by libolt » Wed Jul 11, 2018 10:16 pm

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?
0 x

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 3985
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 184
Contact:

Re: Ogre Version

Post by dark_sylinc » Wed Jul 11, 2018 10:19 pm

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
0 x

paroj
OGRE Team Member
OGRE Team Member
Posts: 798
Joined: Sun Mar 30, 2014 2:51 pm
x 127
Contact:

Re: Ogre Version

Post by paroj » Wed Jul 11, 2018 11:28 pm

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...
0 x

User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 1
Contact:

Re: Ogre Version

Post by mmixLinus » Mon Jan 28, 2019 1:42 pm

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.
0 x
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: 798
Joined: Sun Mar 30, 2014 2:51 pm
x 127
Contact:

Re: Ogre Version

Post by paroj » Mon Jan 28, 2019 3:27 pm

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.
0 x

User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 1
Contact:

Re: Ogre Version

Post by mmixLinus » Mon Jan 28, 2019 8:35 pm

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) : )
0 x
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: 798
Joined: Sun Mar 30, 2014 2:51 pm
x 127
Contact:

Re: Ogre Version

Post by paroj » Tue Jan 29, 2019 12:26 am

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)
0 x

User avatar
mmixLinus
Silver Sponsor
Silver Sponsor
Posts: 199
Joined: Thu Apr 21, 2011 3:08 pm
Location: Lund, Sweden
x 1
Contact:

Re: Ogre Version

Post by mmixLinus » Tue Jan 29, 2019 12:09 pm

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

Post Reply