# Find OGRE includes and library # # This module defines # OGRE_INCLUDE_DIR # OGRE_LIBRARY, the library to link against to use OGRE. # OGRE_FOUND, If false, do not try to use OGRE # # Copyright © 2007, Matt Williams # Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture # of the ETH Zurich (removed later on) # # Redistribution and use is allowed according to the terms of the BSD license. # # Several changes and additions by Fabian 'x3n' Landau # Lots of simplifications by Adrian Friedli # Version checking by Reto Grieder # > www.orxonox.net < INCLUDE(DetermineVersion) INCLUDE(FindPackageHandleAdvancedArgs) INCLUDE(HandleLibraryTypes) FIND_PATH(OGRE_INCLUDE_DIR Ogre.h PATHS $ENV{OGRE_HOME} PATH_SUFFIXES include include/OGRE ) FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED NAMES OgreMain Ogre PATHS $ENV{OGRE_HOME} PATH_SUFFIXES lib bin/Release bin/release Release release ) FIND_LIBRARY(OGRE_LIBRARY_DEBUG NAMES OgreMaind OgreMain_d OgreMainD OgreMain_D Ogred Ogre_d OgreD Ogre_d PATHS $ENV{OGRE_HOME} PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ) # Inspect OgrePrerquisites.h for the version number DETERMINE_VERSION(OGRE ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h) COMPARE_VERSION_STRINGS("${OGRE_VERSION}" "1.9" _version_1_9_compare TRUE) # Version 1.9 moved overlays into a separate component (which means we must find and link to another library) IF(_version_1_9_compare GREATER -1) FIND_LIBRARY(OGRE_OVERLAY_LIBRARY_OPTIMIZED NAMES OgreOverlay PATHS $ENV{OGRE_HOME} PATH_SUFFIXES lib bin/Release bin/release Release release ) FIND_LIBRARY(OGRE_OVERLAY_LIBRARY_DEBUG NAMES OgreOverlayd OgreOverlay_d OgreOverlayD OgreOverlay_D PATHS $ENV{OGRE_HOME} PATH_SUFFIXES lib bin/Debug bin/debug Debug debug ) SET(OGRE_REQUIRED_VARIABLES OGRE_OVERLAY_LIBRARY_OPTIMIZED ) ENDIF() # Handle the REQUIRED argument and set OGRE_FOUND # Also check the version requirements FIND_PACKAGE_HANDLE_ADVANCED_ARGS(OGRE DEFAULT_MSG ${OGRE_VERSION} OGRE_LIBRARY_OPTIMIZED OGRE_INCLUDE_DIR ${OGRE_REQUIRED_VARIABLES} ) # Collect optimized and debug libraries HANDLE_LIBRARY_TYPES(OGRE) HANDLE_LIBRARY_TYPES(OGRE_OVERLAY) MARK_AS_ADVANCED( OGRE_INCLUDE_DIR OGRE_LIBRARY_OPTIMIZED OGRE_LIBRARY_DEBUG OGRE_OVERLAY_LIBRARY_OPTIMIZED OGRE_OVERLAY_LIBRARY_DEBUG )