Little bug in FindOGRE.cmake on GNU/Linux(Ubuntu)

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
User avatar
romeoxbm
Gnoblar
Posts: 15
Joined: Mon Sep 03, 2007 12:58 pm

Little bug in FindOGRE.cmake on GNU/Linux(Ubuntu)

Post by romeoxbm »

Hi everyone!
On ubuntu distributions, plugins and render systems are installed in /usr/lib/<x86_64-linux-gnu|i386-linux-gnu>/OGRE-<ogre version> and FindOGRE.cmake (Ogre 1.9.0) can't find both OGRE_PLUGIN_DIR_REL and OGRE_PLUGIN_DIR_DBG.
This can be easily fixed by adding a new path suffix in find_library command.

Old code:

Code: Select all

  set(OGRE_${PLUGIN}_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
  find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES}
    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt Release Release/opt RelWithDebInfo RelWithDebInfo/opt MinSizeRel MinSizeRel/opt)
  find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG}
    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE opt Debug Debug/opt)
  make_library_set(OGRE_${PLUGIN}_LIBRARY)
New code:

Code: Select all

  set(OGRE_${PLUGIN}_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
  find_library(OGRE_${PLUGIN}_LIBRARY_REL NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES}
    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE [u][color=#FF0000]OGRE-${OGRE_VERSION}[/color][/u] opt Release Release/opt RelWithDebInfo RelWithDebInfo/opt MinSizeRel MinSizeRel/opt)
  find_library(OGRE_${PLUGIN}_LIBRARY_DBG NAMES ${OGRE_${PLUGIN}_LIBRARY_NAMES_DBG}
    HINTS "${OGRE_BUILD}/lib" ${OGRE_LIBRARY_DIRS} PATH_SUFFIXES "" OGRE [u][color=#FF0000]OGRE-${OGRE_VERSION}[/color][/u] opt Debug Debug/opt)
  make_library_set(OGRE_${PLUGIN}_LIBRARY)
This is a little fix and I don't think it worth a pull request, so if someone who has write rights could commit these changes... ;)
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 217

Re: Little bug in FindOGRE.cmake on GNU/Linux(Ubuntu)

Post by scrawl »

Confirmed. Can you make a pull-request for this change?
User avatar
romeoxbm
Gnoblar
Posts: 15
Joined: Mon Sep 03, 2007 12:58 pm

Re: Little bug in FindOGRE.cmake on GNU/Linux(Ubuntu)

Post by romeoxbm »

I'm on it