Ogre Version
-
- Greenskin
- Posts: 126
- Joined: Wed Jan 19, 2005 4:48 am
- x 9
Ogre Version
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?
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1279
- Contact:
Re: Ogre Version
See these macros in OgreMain/include/OgrePrerequisites.h
Cheers
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
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Ogre Version
Code: Select all
#if (OGRE_VERSION < ((1 << 16) | (11 << 8) | 0))
// 1.10
# else
// 1.11
#endif
- mmixLinus
- Silver Sponsor
- Posts: 199
- Joined: Thu Apr 21, 2011 3:08 pm
- Location: Lund, Sweden
- x 12
- Contact:
Re: Ogre Version
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.
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
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Ogre Version
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.
https://bitbucket.org/cegui/cegui/commi ... f7e53163d4
but to answer your question, its in OgreBuildSettings.h since 1.11.5 already.
- mmixLinus
- Silver Sponsor
- Posts: 199
- Joined: Thu Apr 21, 2011 3:08 pm
- Location: Lund, Sweden
- x 12
- Contact:
Re: Ogre Version
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
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
-
- OGRE Team Member
- Posts: 1995
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1075
- Contact:
Re: Ogre Version
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)
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)
- mmixLinus
- Silver Sponsor
- Posts: 199
- Joined: Thu Apr 21, 2011 3:08 pm
- Location: Lund, Sweden
- x 12
- Contact:
Re: Ogre Version
ah ok, I'll check this. Thanks : )the new cmake findconfig infrastructure
Powered by Ogre3D:
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook
MMiX.Me 3D - 3D Music Player
Galaxy Navigator 3D - 2 million stars (ESA's Gaia satellite)
YouTube|Facebook