Page 1 of 1

FindOgre.cmake doesn't find ogre

Posted: Sun Jan 27, 2019 23:29
by mmixLinus
(This is for v0-8 - 16th January 2019. CMake 3.9.4)
So I might be missing something obvious but after setting OGRE_H_BUILD_SETTINGS_PATH and OGRE_H_PATH I still run into ${OGRE_VERSION} being unset. This results in the error

Code: Select all

CMake Error at CMakeLists.txt:113 (if):
  if given arguments:

    "TRUE" "AND" "VERSION_GREATER" "1.11"

  Unknown arguments specified
the line in cegui_mk2\source\CMakeLists.txt:113 is

Code: Select all

if(${OGRE_FOUND} AND ${OGRE_VERSION} VERSION_GREATER 1.11)

After looking into cegui_mk2\source\cmake\FIndOgre.cmake I wonder if (line 252)
file (STRINGS "${OGRE_H_PATH}/OgrePrerequisites.h" _CEGUIOGREVERSIONDEFINES REGEX ".*#define OGRE_VERSION_.*[0-9]+")
shouldn't be
file (STRINGS "${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h" _CEGUIOGREVERSIONDEFINES REGEX ".*#define OGRE_VERSION_.*[0-9]+")
because as far as I understand, the Ogre Version number is NOT in the Prerequisites header, right?

And after that nobody seems to put the MAJOR, MINOR and PATCH numbers together into a VERSION string, so I added the set line:

Code: Select all

    endforeach()
   set (OGRE_VERSION ${CEGUI_FOUND_OGRE_VERSION_MAJOR}.${CEGUI_FOUND_OGRE_VERSION_MINOR}.${CEGUI_FOUND_OGRE_VERSION_PATCH})
else()
which correctly sets OGRE_VERSION to 1.12.0 and CMake continues.
What have I missed to need these changes?

Re: FindOgre.cmake doesn't find ogre

Posted: Mon Jan 28, 2019 07:54
by Ident
Is OGRE_VERSION not in OgrePrerequisites.h? I am pretty sure it used to be.

Re: FindOgre.cmake doesn't find ogre

Posted: Mon Jan 28, 2019 12:50
by mmixLinus
Yep, used to be, but not any longer I think.. Anyway, I'm asking over there.. :)

Re: FindOgre.cmake doesn't find ogre

Posted: Tue Jan 29, 2019 10:23
by mmixLinus
I have a backward compatible fix for this (I tested with VERSION definitions in either Prerequesites.h or BuildSettings.h). Now I just need to create a Pull Request for it. I've never done that for CEGUI before, so bear with me please : ) Is it correct to create a fork on bitbucket?

Re: FindOgre.cmake doesn't find ogre

Posted: Tue Jan 29, 2019 20:43
by Ident

Re: FindOgre.cmake doesn't find ogre

Posted: Thu Feb 07, 2019 10:14
by mmixLinus
On second thought.. Has anyone else had this problem (cegui 0.8.7 + ogre 1.11.5)? I wonder if I just had some initial setup problem..

I can make a PR out of this if anyone else is seeing this problem (ie., it actually exists).