[1505] | 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. |
---|
[1776] | 13 | # |
---|
| 14 | # Several changes and additions by Fabian 'x3n' Landau |
---|
| 15 | # > www.orxonox.net < |
---|
[1505] | 16 | |
---|
[1776] | 17 | IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR) |
---|
| 18 | SET (OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
| 19 | ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR) |
---|
[1505] | 20 | |
---|
| 21 | IF (WIN32) #Windows |
---|
[1776] | 22 | FIND_PATH(OGRE_INCLUDE_DIR Ogre.h |
---|
| 23 | ../libs/ogre/OgreMain/include |
---|
| 24 | ) |
---|
| 25 | |
---|
[1505] | 26 | SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain) |
---|
[1776] | 27 | FIND_LIBRARY(OGRE_LIBDIR NAMES ${OGRE_LIBRARIES} PATHS |
---|
| 28 | ../libs/ogre/Samples/Common/bin/Release |
---|
| 29 | ) |
---|
| 30 | |
---|
| 31 | # Strip the filename from the path |
---|
| 32 | IF (OGRE_LIBDIR) |
---|
| 33 | GET_FILENAME_COMPONENT(OGRE_LIBDIR ${OGRE_LIBDIR} PATH) |
---|
| 34 | SET (OGRE_LIB_DIR ${OGRE_LIBDIR} CACHE FILEPATH "") |
---|
| 35 | ENDIF (OGRE_LIBDIR) |
---|
[1505] | 36 | ELSE (WIN32) #Unix |
---|
| 37 | FIND_PACKAGE(PkgConfig) |
---|
| 38 | PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack |
---|
| 39 | SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS}) |
---|
| 40 | SET(OGRE_LIB_DIR ${OGRE_LIBDIR}) |
---|
[1776] | 41 | SET(OGRE_LIBRARIES ${OGRE_LIBRARIES}) |
---|
[1505] | 42 | ENDIF (WIN32) |
---|
| 43 | |
---|
| 44 | #Do some preparation |
---|
| 45 | SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR) |
---|
| 46 | SEPARATE_ARGUMENTS(OGRE_LIBRARIES) |
---|
| 47 | |
---|
[1776] | 48 | SET (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "") |
---|
| 49 | SET (OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") |
---|
| 50 | SET (OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "") |
---|
[1505] | 51 | |
---|
[1776] | 52 | IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR) |
---|
[1505] | 53 | SET(OGRE_FOUND TRUE) |
---|
[1776] | 54 | ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR) |
---|
[1505] | 55 | |
---|
| 56 | IF (OGRE_FOUND) |
---|
| 57 | IF (NOT OGRE_FIND_QUIETLY) |
---|
[1776] | 58 | MESSAGE(STATUS "Ogre was found.") |
---|
| 59 | IF (VERBOSE_FIND) |
---|
| 60 | MESSAGE (STATUS " include path: ${OGRE_INCLUDE_DIR}") |
---|
| 61 | MESSAGE (STATUS " library path: ${OGRE_LIB_DIR}") |
---|
| 62 | MESSAGE (STATUS " libraries: ${OGRE_LIBRARIES}") |
---|
| 63 | ENDIF (VERBOSE_FIND) |
---|
[1505] | 64 | ENDIF (NOT OGRE_FIND_QUIETLY) |
---|
| 65 | ELSE (OGRE_FOUND) |
---|
[1776] | 66 | IF (NOT OGRE_INCLUDE_DIR) |
---|
| 67 | MESSAGE(SEND_ERROR "Ogre include path was not found.") |
---|
| 68 | ENDIF (NOT OGRE_INCLUDE_DIR) |
---|
| 69 | IF (NOT OGRE_LIB_DIR) |
---|
| 70 | MESSAGE(SEND_ERROR "Ogre library was not found.") |
---|
| 71 | ENDIF (NOT OGRE_LIB_DIR) |
---|
| 72 | IF (NOT OGRE_LIBRARIES) |
---|
| 73 | MESSAGE(SEND_ERROR "Ogre libraries not known.") |
---|
| 74 | ENDIF (NOT OGRE_LIBRARIES) |
---|
[1505] | 75 | ENDIF (OGRE_FOUND) |
---|