Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem2/cmake/FindCEGUI.cmake @ 2624

Last change on this file since 2624 was 2616, checked in by rgrieder, 16 years ago
  • Split FindOggVorbis.cmake in two. Having them in one file doesn't make sense, we can group it somewhere else.
  • Updated all find scripts
  • Removed all standard paths (like /usr /usr/local, etc.) because they're already searched by CMake anyway
  • Several workarounds for certain libraries when using the find script in the CMake module path.
  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
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#  CEGUI_FOUND, If false, do not try to use CEGUI
7#
8# Created by Matt Williams to find OGRE libraries
9# Copyright © 2007, Matt Williams
10#
11# Modified by Nicolas Schlumberger to find CEGUI libraries
12# and make it run on the Tardis-Infrastucture of the ETH Zurich
13# Copyright 2007, Nicolas Schlumberger
14#
15# Redistribution and use is allowed according to the terms of the BSD license.
16#
17# Several changes and additions by Fabian 'x3n' Landau
18# Lots of simplifications by Adrian Friedli
19#                 > www.orxonox.net <
20
21INCLUDE(DetermineVersion)
22INCLUDE(FindPackageHandleAdvancedArgs)
23INCLUDE(HandleLibraryTypes)
24
25FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
26  PATHS $ENV{CEGUIDIR}
27  PATH_SUFFIXES include include/CEGUI
28)
29FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
30  NAMES CEGUIBase
31  PATHS $ENV{CEGUIDIR}
32  PATH_SUFFIXES lib bin
33)
34FIND_LIBRARY(CEGUI_LIBRARY_DEBUG
35  NAMES CEGUIBased CEGUIBase_d
36  PATHS $ENV{CEGUIDIR}
37  PATH_SUFFIXES lib bin
38)
39
40# Inspect CEGUIVersion.h for the version number
41DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
42
43# Handle the REQUIRED argument and set CEGUI_FOUND
44# Also checks the version requirements if given
45FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}"
46  CEGUI_INCLUDE_DIR
47  CEGUI_LIBRARY_OPTIMIZED
48)
49
50# Collect optimized and debug libraries
51HANDLE_LIBRARY_TYPES(CEGUI)
52
53MARK_AS_ADVANCED(
54  CEGUI_INCLUDE_DIR
55  CEGUI_LIBRARY_OPTIMIZED
56  CEGUI_LIBRARY_DEBUG
57)
58
59LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result)
60IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
61  # Also try to find the CEGUILua libraries.
62  # There would already be libraries in src/ for versions 0.5 and 0.6
63  FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED
64    NAMES CEGUILua
65    PATHS $ENV{CEGUIDIR}
66    PATH_SUFFIXES lib bin
67  )
68  FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG
69    NAMES CEGUILuad CEGUILua_d
70    PATHS $ENV{CEGUIDIR}
71    PATH_SUFFIXES lib bin
72  )
73
74  SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED})
75  # Handle the REQUIRED argument and set CEGUILUA_FOUND
76  FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG
77    CEGUILUA_LIBRARY_OPTIMIZED
78  )
79
80  # Collect optimized and debug libraries
81  HANDLE_LIBRARY_TYPES(CEGUILUA)
82
83  MARK_AS_ADVANCED(
84    CEGUILUA_LIBRARY_OPTIMIZED
85    CEGUILUA_LIBRARY_DEBUG
86  )
87
88ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
89  SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE)
90ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1)
91
Note: See TracBrowser for help on using the repository browser.