[1505] | 1 | # Find CEGUI includes and library |
---|
| 2 | # |
---|
| 3 | # This module defines |
---|
| 4 | # CEGUI_INCLUDE_DIR |
---|
[2664] | 5 | # CEGUI_LIBRARY, the library to link against to use CEGUI. |
---|
[1505] | 6 | # CEGUI_FOUND, If false, do not try to use CEGUI |
---|
[2664] | 7 | # CEGUI_VERSION, the version as string "x.y.z" |
---|
| 8 | # CEGUILUA_LIBRARY, Script module library |
---|
| 9 | # CEGUILUA_USE_INTERNAL_LIBRARY, True if CEGUILUA_LIBRARY was not defined here |
---|
[1505] | 10 | # |
---|
[2664] | 11 | # Input: |
---|
| 12 | # ENV{CEGUIDIR}, CEGUI path, optional |
---|
| 13 | # FIND CEGUILUA_INTERNAL_SUPPORT, List of all CEGUILua version supported |
---|
| 14 | # in the source repository |
---|
| 15 | # CEGUILUA_USE_EXTERNAL_LIBRARY, Force finding of CEGUILua |
---|
| 16 | # |
---|
[1505] | 17 | # Created by Matt Williams to find OGRE libraries |
---|
| 18 | # Copyright © 2007, Matt Williams |
---|
| 19 | # |
---|
| 20 | # Modified by Nicolas Schlumberger to find CEGUI libraries |
---|
| 21 | # and make it run on the Tardis-Infrastucture of the ETH Zurich |
---|
| 22 | # Copyright 2007, Nicolas Schlumberger |
---|
| 23 | # |
---|
| 24 | # Redistribution and use is allowed according to the terms of the BSD license. |
---|
[1776] | 25 | # |
---|
| 26 | # Several changes and additions by Fabian 'x3n' Landau |
---|
[2664] | 27 | # Lots of simplifications by Adrian Friedli and Reto Grieder |
---|
| 28 | # Version checking and CEGUILua finding by Reto Grieder |
---|
[1776] | 29 | # > www.orxonox.net < |
---|
[1505] | 30 | |
---|
[2664] | 31 | INCLUDE(DetermineVersion) |
---|
| 32 | INCLUDE(FindPackageHandleAdvancedArgs) |
---|
| 33 | INCLUDE(HandleLibraryTypes) |
---|
[1505] | 34 | |
---|
[2664] | 35 | FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h |
---|
| 36 | PATHS $ENV{CEGUIDIR} |
---|
| 37 | PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers |
---|
| 38 | ) |
---|
| 39 | FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED |
---|
| 40 | NAMES CEGUIBase CEGUI |
---|
| 41 | PATHS $ENV{CEGUIDIR} |
---|
| 42 | PATH_SUFFIXES lib bin |
---|
| 43 | ) |
---|
| 44 | FIND_LIBRARY(CEGUI_LIBRARY_DEBUG |
---|
| 45 | NAMES |
---|
| 46 | CEGUIBased CEGUIBase_d CEGUIBaseD CEGUIBase_D |
---|
| 47 | CEGUId CEGUI_d CEGUID CEGUI_D |
---|
| 48 | PATHS $ENV{CEGUIDIR} |
---|
| 49 | PATH_SUFFIXES lib bin |
---|
| 50 | ) |
---|
[1776] | 51 | |
---|
[2664] | 52 | # Inspect CEGUIVersion.h for the version number |
---|
| 53 | DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) |
---|
[1776] | 54 | |
---|
[2664] | 55 | # Handle the REQUIRED argument and set CEGUI_FOUND |
---|
| 56 | # Also checks the version requirements if given |
---|
| 57 | FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}" |
---|
| 58 | CEGUI_LIBRARY_OPTIMIZED |
---|
| 59 | CEGUI_INCLUDE_DIR |
---|
| 60 | ) |
---|
[1776] | 61 | |
---|
[2664] | 62 | # Collect optimized and debug libraries |
---|
| 63 | HANDLE_LIBRARY_TYPES(CEGUI) |
---|
[1776] | 64 | |
---|
[2664] | 65 | MARK_AS_ADVANCED( |
---|
| 66 | CEGUI_INCLUDE_DIR |
---|
| 67 | CEGUI_LIBRARY_OPTIMIZED |
---|
| 68 | CEGUI_LIBRARY_DEBUG |
---|
| 69 | ) |
---|
[1776] | 70 | |
---|
[2664] | 71 | LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result) |
---|
| 72 | IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
| 73 | # Also try to find the CEGUILua libraries. |
---|
| 74 | # There would already be libraries in src/ for versions 0.5 and 0.6 |
---|
| 75 | FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED |
---|
| 76 | NAMES CEGUILua |
---|
| 77 | PATHS $ENV{CEGUIDIR} |
---|
| 78 | PATH_SUFFIXES lib bin |
---|
| 79 | ) |
---|
| 80 | FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG |
---|
| 81 | NAMES CEGUILuad CEGUILua_d |
---|
| 82 | PATHS $ENV{CEGUIDIR} |
---|
| 83 | PATH_SUFFIXES lib bin |
---|
| 84 | ) |
---|
[1505] | 85 | |
---|
[2664] | 86 | SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED}) |
---|
| 87 | # Handle the REQUIRED argument and set CEGUILUA_FOUND |
---|
| 88 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG |
---|
| 89 | CEGUILUA_LIBRARY_OPTIMIZED |
---|
| 90 | ) |
---|
[1505] | 91 | |
---|
[2664] | 92 | # Collect optimized and debug libraries |
---|
| 93 | HANDLE_LIBRARY_TYPES(CEGUILUA) |
---|
[1505] | 94 | |
---|
[2664] | 95 | MARK_AS_ADVANCED( |
---|
| 96 | CEGUILUA_LIBRARY_OPTIMIZED |
---|
| 97 | CEGUILUA_LIBRARY_DEBUG |
---|
| 98 | ) |
---|
[1505] | 99 | |
---|
[2664] | 100 | ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
| 101 | SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE) |
---|
| 102 | ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
[1776] | 103 | |
---|