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