1 | # Find CEGUI includes and library |
---|
2 | # |
---|
3 | # This module defines |
---|
4 | # CEGUI_INCLUDE_DIR |
---|
5 | # CEGUI_LIBRARY, the library to link against to use CEGUI. |
---|
6 | # CEGUILUA_LIBRARY, the library to link against to use the CEGUI script module. |
---|
7 | # CEGUI_TOLUA_LIBRARY, the library to link against to use Tolua++. |
---|
8 | # CEGUI_FOUND, If false, do not try to use CEGUI |
---|
9 | # CEGUI_VERSION, the version as string "x.y.z" |
---|
10 | # |
---|
11 | # Input: |
---|
12 | # ENV{CEGUIDIR}, CEGUI path, optional |
---|
13 | # |
---|
14 | # Created by Matt Williams to find OGRE libraries |
---|
15 | # Copyright © 2007, Matt Williams |
---|
16 | # |
---|
17 | # Modified by Nicolas Schlumberger to find CEGUI libraries |
---|
18 | # and make it run on the Tardis-Infrastucture of the ETH Zurich |
---|
19 | # Copyright 2007, Nicolas Schlumberger |
---|
20 | # |
---|
21 | # Redistribution and use is allowed according to the terms of the BSD license. |
---|
22 | # |
---|
23 | # Several changes and additions by Fabian 'x3n' Landau |
---|
24 | # Lots of simplifications by Adrian Friedli and Reto Grieder |
---|
25 | # Version checking and CEGUILua finding by Reto Grieder |
---|
26 | # > www.orxonox.net < |
---|
27 | |
---|
28 | INCLUDE(CompareVersionStrings) |
---|
29 | INCLUDE(DetermineVersion) |
---|
30 | INCLUDE(FindPackageHandleAdvancedArgs) |
---|
31 | INCLUDE(HandleLibraryTypes) |
---|
32 | |
---|
33 | # Find CEGUI headers |
---|
34 | FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h |
---|
35 | PATHS $ENV{CEGUIDIR} |
---|
36 | PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers |
---|
37 | ) |
---|
38 | |
---|
39 | # Inspect CEGUIVersion.h for the version number |
---|
40 | DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) |
---|
41 | |
---|
42 | # Find CEGUI library |
---|
43 | FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED |
---|
44 | NAMES CEGUIBase CEGUI |
---|
45 | PATHS $ENV{CEGUIDIR} |
---|
46 | PATH_SUFFIXES lib bin CEGUIBase.framework CEGUI.framework |
---|
47 | ) |
---|
48 | FIND_LIBRARY(CEGUI_LIBRARY_DEBUG |
---|
49 | NAMES |
---|
50 | CEGUIBased CEGUIBase_d CEGUIBaseD CEGUIBase_D |
---|
51 | CEGUId CEGUI_d CEGUID CEGUI_D |
---|
52 | PATHS $ENV{CEGUIDIR} |
---|
53 | PATH_SUFFIXES lib bin |
---|
54 | ) |
---|
55 | |
---|
56 | # Find CEGUILua headers |
---|
57 | FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h |
---|
58 | PATHS $ENV{CEGUIDIR} ${CEGUI_INCLUDE_DIR}/ScriptingModules/LuaScriptModule |
---|
59 | PATH_SUFFIXES include include/CEGUI CEGUILuaScriptModule.framework/Headers |
---|
60 | ) |
---|
61 | # Find CEGUILua libraries |
---|
62 | FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED |
---|
63 | NAMES CEGUILua CEGUILuaScriptModule |
---|
64 | PATHS $ENV{CEGUIDIR} |
---|
65 | PATH_SUFFIXES lib bin CEGUILuaScriptModule.framework |
---|
66 | ) |
---|
67 | FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG |
---|
68 | NAMES CEGUILuad CEGUILua_d CEGUILuaScriptModuled CEGUILuaScriptModule_d |
---|
69 | PATHS $ENV{CEGUIDIR} |
---|
70 | PATH_SUFFIXES lib bin |
---|
71 | ) |
---|
72 | |
---|
73 | # Find CEGUI Tolua++ include file |
---|
74 | # We only need to add this path since we use tolua++ like a normal |
---|
75 | # dependency but it is shipped with CEGUILua. |
---|
76 | FIND_PATH(CEGUI_TOLUA_INCLUDE_DIR tolua++.h |
---|
77 | PATHS |
---|
78 | ${CEGUILUA_INCLUDE_DIR} |
---|
79 | # For newer CEGUI versions >= 0.7 |
---|
80 | ${CEGUILUA_INCLUDE_DIR}/support/tolua++ |
---|
81 | # For Apples |
---|
82 | $ENV{CEGUIDIR} |
---|
83 | PATH_SUFFIXES ceguitolua++.framework/Headers |
---|
84 | NO_DEFAULT_PATH # MUST be in CEGUILUA_INCLUDE_DIR somewhere |
---|
85 | ) |
---|
86 | # Find CEGUI Tolua++ libraries |
---|
87 | FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED |
---|
88 | NAMES CEGUItoluapp tolua++ ceguitolua++ |
---|
89 | PATHS $ENV{CEGUIDIR} |
---|
90 | PATH_SUFFIXES lib bin ceguitolua++.framework |
---|
91 | ) |
---|
92 | FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_DEBUG |
---|
93 | NAMES CEGUItoluappd CEGUItoluapp_d tolua++d tolua++_d |
---|
94 | PATHS $ENV{CEGUIDIR} |
---|
95 | PATH_SUFFIXES lib bin |
---|
96 | ) |
---|
97 | |
---|
98 | # Newer versions of CEGUI have the renderer for OGRE shipped with them |
---|
99 | COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE) |
---|
100 | IF(_version_compare GREATER -1) |
---|
101 | # Find CEGUI OGRE Renderer headers |
---|
102 | FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h |
---|
103 | PATHS $ENV{CEGUIDIR} ${CEGUI_INCLUDE_DIR}/RendererModules/Ogre |
---|
104 | PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers |
---|
105 | ) |
---|
106 | # Find CEGUI OGRE Renderer libraries |
---|
107 | FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED |
---|
108 | NAMES CEGUIOgreRenderer |
---|
109 | PATHS $ENV{CEGUIDIR} |
---|
110 | PATH_SUFFIXES lib bin |
---|
111 | ) |
---|
112 | FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG |
---|
113 | NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d |
---|
114 | PATHS $ENV{CEGUIDIR} |
---|
115 | PATH_SUFFIXES lib bin |
---|
116 | ) |
---|
117 | SET(CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES |
---|
118 | CEGUI_OGRE_RENDERER_INCLUDE_DIR |
---|
119 | CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED |
---|
120 | ) |
---|
121 | ELSE() |
---|
122 | SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE) |
---|
123 | ENDIF() |
---|
124 | |
---|
125 | # Handle the REQUIRED argument and set CEGUI_FOUND |
---|
126 | # Also checks the version requirements if given |
---|
127 | FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}" |
---|
128 | CEGUI_INCLUDE_DIR |
---|
129 | CEGUI_LIBRARY_OPTIMIZED |
---|
130 | CEGUILUA_INCLUDE_DIR |
---|
131 | CEGUILUA_LIBRARY_OPTIMIZED |
---|
132 | CEGUI_TOLUA_INCLUDE_DIR |
---|
133 | CEGUI_TOLUA_LIBRARY_OPTIMIZED |
---|
134 | ${CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES} |
---|
135 | ) |
---|
136 | |
---|
137 | # Collect optimized and debug libraries |
---|
138 | HANDLE_LIBRARY_TYPES(CEGUI) |
---|
139 | HANDLE_LIBRARY_TYPES(CEGUILUA) |
---|
140 | HANDLE_LIBRARY_TYPES(CEGUI_TOLUA) |
---|
141 | IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED) |
---|
142 | HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER) |
---|
143 | ENDIF() |
---|
144 | |
---|
145 | MARK_AS_ADVANCED( |
---|
146 | CEGUI_INCLUDE_DIR |
---|
147 | CEGUI_LIBRARY_OPTIMIZED |
---|
148 | CEGUI_LIBRARY_DEBUG |
---|
149 | CEGUILUA_INCLUDE_DIR |
---|
150 | CEGUILUA_LIBRARY_OPTIMIZED |
---|
151 | CEGUILUA_LIBRARY_DEBUG |
---|
152 | CEGUI_TOLUA_INCLUDE_DIR |
---|
153 | CEGUI_TOLUA_LIBRARY_OPTIMIZED |
---|
154 | CEGUI_TOLUA_LIBRARY_DEBUG |
---|
155 | CEGUI_OGRE_RENDERER_INCLUDE_DIR |
---|
156 | CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED |
---|
157 | CEGUI_OGRE_RENDERER_LIBRARY_DEBUG |
---|
158 | ) |
---|