Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/mainloop/cmake/FindOGRE.cmake @ 423

Last change on this file since 423 was 90, checked in by nicolasc, 17 years ago

modified copyright info in cmake-finder

File size: 1.9 KB
Line 
1# Find OGRE includes and library
2#
3# This module defines
4#  OGRE_INCLUDE_DIR
5#  OGRE_LIBRARIES, the libraries to link against to use OGRE.
6#  OGRE_LIB_DIR, the location of the libraries
7#  OGRE_FOUND, If false, do not try to use OGRE
8#
9# Copyright © 2007, Matt Williams
10# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich
11#
12# Redistribution and use is allowed according to the terms of the BSD license.
13
14IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
15    SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
16ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
17
18IF (WIN32) #Windows
19    MESSAGE(STATUS "Looking for OGRE")
20    SET(OGRESDK $ENV{OGRE_HOME})
21    STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}" )
22    SET(OGRE_INCLUDE_DIR ${OGRESDK}/include)
23    SET(OGRE_LIB_DIR ${OGRESDK}/lib)
24    SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
25ELSE (WIN32) #Unix
26    FIND_PACKAGE(PkgConfig)
27    PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
28    SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
29    SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
30    SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
31ENDIF (WIN32)
32
33#Do some preparation
34SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
35SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
36
37SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
38SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
39SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
40
41IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
42    SET(OGRE_FOUND TRUE)
43ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
44
45IF (OGRE_FOUND)
46    IF (NOT OGRE_FIND_QUIETLY)
47        MESSAGE(STATUS "  libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}")
48        MESSAGE(STATUS "  includes  : ${OGRE_INCLUDE_DIR}")
49    ENDIF (NOT OGRE_FIND_QUIETLY)
50ELSE (OGRE_FOUND)
51    IF (OGRE_FIND_REQUIRED)
52        MESSAGE(FATAL_ERROR "Could not find OGRE")
53    ENDIF (OGRE_FIND_REQUIRED)
54ENDIF (OGRE_FOUND)
Note: See TracBrowser for help on using the repository browser.