Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/cegui0.8_ogre1.9/cmake/tools/FindCEGUI.cmake @ 12209

Last change on this file since 12209 was 11810, checked in by landauf, 7 years ago

added path to cegui for ubuntu 17.10 and also making cegui 0.8 the minimal supported version

  • Property svn:eol-style set to native
File size: 5.7 KB
RevLine 
[1505]1# Find CEGUI includes and library
2#
3# This module defines
4#  CEGUI_INCLUDE_DIR
[2710]5#  CEGUI_LIBRARY, the library to link against to use CEGUI.
[8351]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++.
[1505]8#  CEGUI_FOUND, If false, do not try to use CEGUI
[2710]9#  CEGUI_VERSION, the version as string "x.y.z"
[1505]10#
[2710]11# Input:
12#  ENV{CEGUIDIR}, CEGUI path, optional
13#
[1505]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.
[1776]22#
23# Several changes and additions by Fabian 'x3n' Landau
[2710]24# Lots of simplifications by Adrian Friedli and Reto Grieder
25# Version checking and CEGUILua finding by Reto Grieder
[1776]26#                 > www.orxonox.net <
[1505]27
[8351]28INCLUDE(CompareVersionStrings)
[2710]29INCLUDE(DetermineVersion)
30INCLUDE(FindPackageHandleAdvancedArgs)
31INCLUDE(HandleLibraryTypes)
[1505]32
[9675]33# Determine CEGUI's version
34FIND_FILE(CEGUI_VERSION_FILE CEGUIVersion.h Version.h
[2710]35  PATHS $ENV{CEGUIDIR}
[11798]36  PATH_SUFFIXES
37    include
38    include/CEGUI
39    include/cegui-0.8.4/CEGUI
[11810]40    include/cegui-0.8.7/CEGUI
[2710]41)
[9675]42DETERMINE_VERSION(CEGUI ${CEGUI_VERSION_FILE})
[8351]43
[9675]44# Find CEGUI headers
[11795]45COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.8" _version_0_8_compare)
[9675]46# Version 0.8 introduced a new directory and file naming convention
47IF(_version_0_8_compare GREATER -1)
48  # 0.8 and newer
49  FIND_PATH(CEGUI_INCLUDE_DIR CEGUI/CEGUI.h
50    PATHS $ENV{CEGUIDIR}
[11798]51    PATH_SUFFIXES
52      include
53      include/cegui-${CEGUI_VERSION}/
[9675]54  )
55ELSE()
[11101]56  # 0.7 and older
[9675]57  FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
58    PATHS $ENV{CEGUIDIR}
59    PATH_SUFFIXES include include/CEGUI
60  )
61ENDIF()
[8351]62
63# Find CEGUI library
[2710]64FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
[9675]65  NAMES CEGUIBase CEGUI CEGUIBase-0
[2710]66  PATHS $ENV{CEGUIDIR}
67  PATH_SUFFIXES lib bin
68)
69FIND_LIBRARY(CEGUI_LIBRARY_DEBUG
70  NAMES
71    CEGUIBased CEGUIBase_d CEGUIBaseD CEGUIBase_D
[10208]72    CEGUId CEGUI_d CEGUID CEGUI_D CEGUIBase-0_d
[2710]73  PATHS $ENV{CEGUIDIR}
74  PATH_SUFFIXES lib bin
75)
[1776]76
[8351]77# Find CEGUILua headers
[9675]78FIND_PATH(CEGUILUA_INCLUDE_DIR CEGUILua.h Functor.h
[8351]79  PATHS
80    $ENV{CEGUIDIR}
81    $ENV{CEGUILUADIR}
82    ${CEGUI_INCLUDE_DIR}/ScriptingModules/LuaScriptModule
[9675]83    ${CEGUI_INCLUDE_DIR}/CEGUI/ScriptModules/Lua
[8351]84  PATH_SUFFIXES include include/CEGUI
85)
86# Find CEGUILua libraries
87FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
[9675]88  NAMES CEGUILua CEGUILuaScriptModule CEGUILuaScriptModule-0
[8351]89  PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
90  PATH_SUFFIXES lib bin
91)
92FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
93  NAMES CEGUILuad CEGUILua_d CEGUILuaScriptModuled CEGUILuaScriptModule_d
[10208]94  CEGUILuaScriptModule-0_d
[8351]95  PATHS $ENV{CEGUIDIR} $ENV{CEGUILUADIR}
96  PATH_SUFFIXES lib bin
97)
[1776]98
[8351]99# Find CEGUI Tolua++ include file
100# We only need to add this path since we use tolua++ like a normal
101# dependency but it is shipped with CEGUILua.
102FIND_PATH(CEGUI_TOLUA_INCLUDE_DIR tolua++.h
103  PATHS
104    ${CEGUILUA_INCLUDE_DIR}
105    # For newer CEGUI versions >= 0.7
106    ${CEGUILUA_INCLUDE_DIR}/support/tolua++
[9675]107    ${DEP_INCLUDE_DIR}/tolua++/include
[8351]108    # For Mac OS X, tolua++ is a separate framework in the dependency package
109    ${DEP_FRAMEWORK_DIR}
110)
111# Find CEGUI Tolua++ libraries
112FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_OPTIMIZED
[11117]113  NAMES CEGUItoluapp tolua++ toluapp ceguitolua++ tolua++5.1
[8351]114  PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR}
115  PATH_SUFFIXES lib bin
116)
117FIND_LIBRARY(CEGUI_TOLUA_LIBRARY_DEBUG
118  NAMES CEGUItoluappd CEGUItoluapp_d tolua++d tolua++_d
119  PATHS $ENV{CEGUIDIR} ${CEGUITOLUADIR}
120  PATH_SUFFIXES lib bin
121)
122
123# Newer versions of CEGUI have the renderer for OGRE shipped with them
[9675]124COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_0_7_compare TRUE)
125IF(_version_0_7_compare GREATER -1)
[8351]126  # Find CEGUI OGRE Renderer headers
[9675]127  FIND_PATH(CEGUI_OGRE_RENDERER_INCLUDE_DIR CEGUIOgreRenderer.h Renderer.h
[8351]128    PATHS
129      $ENV{CEGUIDIR}
130      $ENV{CEGUIOGRERENDERERDIR}
131      ${CEGUI_INCLUDE_DIR}/RendererModules/Ogre
[11798]132      ${CEGUI_INCLUDE_DIR}/CEGUI/RendererModules/Ogre
[8351]133    PATH_SUFFIXES include include/CEGUI
134  )
135  # Find CEGUI OGRE Renderer libraries
136  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
[9675]137    NAMES CEGUIOgreRenderer CEGUIOgreRenderer-0
[8351]138    PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
139    PATH_SUFFIXES lib bin
140  )
141  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
[10208]142    NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d CEGUIOgreRenderer-0_d
[8351]143    PATHS $ENV{CEGUIDIR} $ENV{CEGUIOGRERENDERERDIR}
144    PATH_SUFFIXES lib bin
145  )
146  SET(CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES
147    CEGUI_OGRE_RENDERER_INCLUDE_DIR
148    CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
149  )
150ELSE()
151  SET(CEGUI_OLD_VERSION TRUE)
152  SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE)
153ENDIF()
154
[2710]155# Handle the REQUIRED argument and set CEGUI_FOUND
156# Also checks the version requirements if given
157FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}"
[8351]158  CEGUI_INCLUDE_DIR
[2710]159  CEGUI_LIBRARY_OPTIMIZED
[8351]160  CEGUILUA_INCLUDE_DIR
161  CEGUILUA_LIBRARY_OPTIMIZED
162  CEGUI_TOLUA_INCLUDE_DIR
163  CEGUI_TOLUA_LIBRARY_OPTIMIZED
164  ${CEGUI_OGRE_RENDERER_REQUIRED_VARIABLES}
[2710]165)
[1776]166
[2710]167# Collect optimized and debug libraries
168HANDLE_LIBRARY_TYPES(CEGUI)
[8351]169HANDLE_LIBRARY_TYPES(CEGUILUA)
170HANDLE_LIBRARY_TYPES(CEGUI_TOLUA)
171IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
172  HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER)
173ENDIF()
[1776]174
[2710]175MARK_AS_ADVANCED(
176  CEGUI_INCLUDE_DIR
177  CEGUI_LIBRARY_OPTIMIZED
178  CEGUI_LIBRARY_DEBUG
[8351]179  CEGUILUA_INCLUDE_DIR
180  CEGUILUA_LIBRARY_OPTIMIZED
181  CEGUILUA_LIBRARY_DEBUG
182  CEGUI_TOLUA_INCLUDE_DIR
183  CEGUI_TOLUA_LIBRARY_OPTIMIZED
184  CEGUI_TOLUA_LIBRARY_DEBUG
185  CEGUI_OGRE_RENDERER_INCLUDE_DIR
186  CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
187  CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
[2710]188)
Note: See TracBrowser for help on using the repository browser.