1 | # Find CEGUI_OGRE includes and library |
---|
2 | # |
---|
3 | # This module defines |
---|
4 | # CEGUI_OGRE_INCLUDE_DIR |
---|
5 | # CEGUI_OGRE_LIBRARIES, the libraries to link against to use CEGUI_OGRE. |
---|
6 | # CEGUI_OGRE_LIB_DIR, the location of the libraries |
---|
7 | # CEGUI_OGRE_FOUND, If false, do not try to use CEGUI_OGRE |
---|
8 | # |
---|
9 | # Created by Matt Williams to find OGRE libraries |
---|
10 | # Copyright © 2007, Matt Williams |
---|
11 | # |
---|
12 | # Modified by Nicolas Schlumberger to find CEGUI-OGRE libraries |
---|
13 | # and make it run on the Tardis-Infrastucture of the ETH Zurich |
---|
14 | # Copyright 2007, Nicolas Schlumberger |
---|
15 | # |
---|
16 | # Redistribution and use is allowed according to the terms of the BSD license. |
---|
17 | |
---|
18 | IF (CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_INCLUDE_DIR) |
---|
19 | SET(CEGUI_OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
20 | ENDIF (CEGUI_OGRE_LIBRARIES AND CEGUI_OGRE_INCLUDE_DIR) |
---|
21 | |
---|
22 | IF (WIN32) #Windows |
---|
23 | MESSAGE(STATUS "Looking for CEGUI_OGRE") |
---|
24 | SET(CEGUI_OGRE_INCLUDE_DIR ../ogre/Samples/Common/CEGUIRenderer/include) |
---|
25 | SET(CEGUI_OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ogre/Samples/Common/bin/Release/lib) |
---|
26 | SET(CEGUI_OGRE_LIBRARIES debug OgreGUIRenderer_d optimized OgreGUIRenderer) |
---|
27 | ELSE (WIN32) #Unix |
---|
28 | FIND_PACKAGE(PkgConfig) |
---|
29 | PKG_SEARCH_MODULE(CEGUI_OGRE CEGUI-OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI-OGRE.pc) # tardis specific hack |
---|
30 | SET(CEGUI_OGRE_INCLUDE_DIR ${CEGUI_OGRE_INCLUDE_DIRS}) |
---|
31 | SET(CEGUI_OGRE_LIB_DIR ${CEGUI_OGRE_LIBDIR}) |
---|
32 | SET(CEGUI_OGRE_LIBRARIES ${CEGUI_OGRE_LIBRARIES} CACHE STRING "") |
---|
33 | ENDIF (WIN32) |
---|
34 | |
---|
35 | #Do some preparation |
---|
36 | SEPARATE_ARGUMENTS(CEGUI_OGRE_INCLUDE_DIR) |
---|
37 | SEPARATE_ARGUMENTS(CEGUI_OGRE_LIBRARIES) |
---|
38 | |
---|
39 | SET(CEGUI_OGRE_INCLUDE_DIR ${CEGUI_OGRE_INCLUDE_DIR} CACHE PATH "") |
---|
40 | SET(CEGUI_OGRE_LIBRARIES ${CEGUI_OGRE_LIBRARIES} CACHE STRING "") |
---|
41 | SET(CEGUI_OGRE_LIB_DIR ${CEGUI_OGRE_LIB_DIR} CACHE PATH "") |
---|
42 | |
---|
43 | IF (CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIBRARIES) |
---|
44 | SET(CEGUI_OGRE_FOUND TRUE) |
---|
45 | ENDIF (CEGUI_OGRE_INCLUDE_DIR AND CEGUI_OGRE_LIBRARIES) |
---|
46 | |
---|
47 | IF (CEGUI_OGRE_FOUND) |
---|
48 | IF (NOT CEGUI_OGRE_FIND_QUIETLY) |
---|
49 | MESSAGE(STATUS " libraries : ${CEGUI_OGRE_LIBRARIES} from ${CEGUI_OGRE_LIB_DIR}") |
---|
50 | MESSAGE(STATUS " includes : ${CEGUI_OGRE_INCLUDE_DIR}") |
---|
51 | ENDIF (NOT CEGUI_OGRE_FIND_QUIETLY) |
---|
52 | ELSE (CEGUI_OGRE_FOUND) |
---|
53 | IF (CEGUI_OGRE_FIND_REQUIRED) |
---|
54 | MESSAGE(FATAL_ERROR "Could not find CEGUI_OGRE") |
---|
55 | ENDIF (CEGUI_OGRE_FIND_REQUIRED) |
---|
56 | ENDIF (CEGUI_OGRE_FOUND) |
---|