[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. |
---|
| 13 | |
---|
| 14 | IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR) |
---|
| 15 | SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
| 16 | ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR) |
---|
| 17 | |
---|
| 18 | IF (WIN32) #Windows |
---|
| 19 | MESSAGE(STATUS "Looking for OGRE") |
---|
| 20 | SET(OGRE_INCLUDE_DIR ../libs/ogre/OgreMain/include) |
---|
| 21 | SET(OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libs/ogre/Samples/Common/bin/Release) |
---|
| 22 | SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain) |
---|
| 23 | ELSE (WIN32) #Unix |
---|
| 24 | FIND_PACKAGE(PkgConfig) |
---|
| 25 | PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack |
---|
| 26 | SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS}) |
---|
| 27 | SET(OGRE_LIB_DIR ${OGRE_LIBDIR}) |
---|
| 28 | SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") |
---|
| 29 | ENDIF (WIN32) |
---|
| 30 | |
---|
| 31 | #Do some preparation |
---|
| 32 | SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR) |
---|
| 33 | SEPARATE_ARGUMENTS(OGRE_LIBRARIES) |
---|
| 34 | |
---|
| 35 | SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "") |
---|
| 36 | SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") |
---|
| 37 | SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "") |
---|
| 38 | |
---|
| 39 | IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES) |
---|
| 40 | SET(OGRE_FOUND TRUE) |
---|
| 41 | ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES) |
---|
| 42 | |
---|
| 43 | IF (OGRE_FOUND) |
---|
| 44 | IF (NOT OGRE_FIND_QUIETLY) |
---|
| 45 | MESSAGE(STATUS " libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}") |
---|
| 46 | MESSAGE(STATUS " includes : ${OGRE_INCLUDE_DIR}") |
---|
| 47 | ENDIF (NOT OGRE_FIND_QUIETLY) |
---|
| 48 | ELSE (OGRE_FOUND) |
---|
| 49 | IF (OGRE_FIND_REQUIRED) |
---|
| 50 | MESSAGE(FATAL_ERROR "Could not find OGRE") |
---|
| 51 | ENDIF (OGRE_FIND_REQUIRED) |
---|
| 52 | ENDIF (OGRE_FOUND) |
---|