Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/cegui0.8_ogre1.9/cmake/tools/FindOGRE.cmake @ 12099

Last change on this file since 12099 was 11795, checked in by landauf, 6 years ago

merged ogre1.9 (including cegui0.8) into new branch

  • Property svn:eol-style set to native
File size: 2.3 KB
RevLine 
[1505]1# Find OGRE includes and library
2#
3# This module defines
4#  OGRE_INCLUDE_DIR
[2710]5#  OGRE_LIBRARY, the library to link against to use OGRE.
[1505]6#  OGRE_FOUND, If false, do not try to use OGRE
7#
8# Copyright © 2007, Matt Williams
[2710]9# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture
10# of the ETH Zurich (removed later on)
[1505]11#
12# Redistribution and use is allowed according to the terms of the BSD license.
[1776]13#
14# Several changes and additions by Fabian 'x3n' Landau
[2710]15# Lots of simplifications by Adrian Friedli
16# Version checking by Reto Grieder
[1776]17#                 > www.orxonox.net <
[1505]18
[2710]19INCLUDE(DetermineVersion)
20INCLUDE(FindPackageHandleAdvancedArgs)
21INCLUDE(HandleLibraryTypes)
[1505]22
[2710]23FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
24  PATHS $ENV{OGRE_HOME}
[8351]25  PATH_SUFFIXES include include/OGRE
[2710]26)
27FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED
28  NAMES OgreMain Ogre
29  PATHS $ENV{OGRE_HOME}
30  PATH_SUFFIXES lib bin/Release bin/release Release release
31)
32FIND_LIBRARY(OGRE_LIBRARY_DEBUG
33  NAMES OgreMaind OgreMain_d OgreMainD OgreMain_D Ogred Ogre_d OgreD Ogre_d
34  PATHS $ENV{OGRE_HOME}
[8351]35  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug
[2710]36)
[1776]37
[2710]38# Inspect OgrePrerquisites.h for the version number
39DETERMINE_VERSION(OGRE ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h)
[11795]40COMPARE_VERSION_STRINGS("${OGRE_VERSION}" "1.9" _version_1_9_compare TRUE)
41# Version 1.9 moved overlays into a separate component (which means we must find and link to another library)
42IF(_version_1_9_compare GREATER -1)
43  FIND_LIBRARY(OGRE_OVERLAY_LIBRARY_OPTIMIZED
44    NAMES OgreOverlay
45    PATHS $ENV{OGRE_HOME}
46    PATH_SUFFIXES lib bin/Release bin/release Release release
47  )
48  FIND_LIBRARY(OGRE_OVERLAY_LIBRARY_DEBUG
49    NAMES OgreOverlayd OgreOverlay_d OgreOverlayD OgreOverlay_D
50    PATHS $ENV{OGRE_HOME}
51    PATH_SUFFIXES lib bin/Debug bin/debug Debug debug
52  )
53  SET(OGRE_REQUIRED_VARIABLES
54    OGRE_OVERLAY_LIBRARY_OPTIMIZED
55  )
56ENDIF()
[1776]57
[2710]58# Handle the REQUIRED argument and set OGRE_FOUND
59# Also check the version requirements
60FIND_PACKAGE_HANDLE_ADVANCED_ARGS(OGRE DEFAULT_MSG ${OGRE_VERSION}
61  OGRE_LIBRARY_OPTIMIZED
62  OGRE_INCLUDE_DIR
[11795]63  ${OGRE_REQUIRED_VARIABLES}
[2710]64)
[1505]65
[2710]66# Collect optimized and debug libraries
67HANDLE_LIBRARY_TYPES(OGRE)
[11795]68HANDLE_LIBRARY_TYPES(OGRE_OVERLAY)
[1505]69
[2710]70MARK_AS_ADVANCED(
71  OGRE_INCLUDE_DIR
72  OGRE_LIBRARY_OPTIMIZED
73  OGRE_LIBRARY_DEBUG
[11795]74  OGRE_OVERLAY_LIBRARY_OPTIMIZED
75  OGRE_OVERLAY_LIBRARY_DEBUG
[2710]76)
Note: See TracBrowser for help on using the repository browser.