[1505] | 1 | # Find CEGUI includes and library |
---|
| 2 | # |
---|
| 3 | # This module defines |
---|
| 4 | # CEGUI_INCLUDE_DIR |
---|
[2509] | 5 | # CEGUI_LIBRARY, the library to link against to use CEGUI. |
---|
[1505] | 6 | # CEGUI_FOUND, If false, do not try to use CEGUI |
---|
[2626] | 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 | # |
---|
[2626] | 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 |
---|
[2626] | 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 | |
---|
[2616] | 31 | INCLUDE(DetermineVersion) |
---|
| 32 | INCLUDE(FindPackageHandleAdvancedArgs) |
---|
[2583] | 33 | INCLUDE(HandleLibraryTypes) |
---|
| 34 | |
---|
[2509] | 35 | FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h |
---|
[2616] | 36 | PATHS $ENV{CEGUIDIR} |
---|
| 37 | PATH_SUFFIXES include include/CEGUI |
---|
[2509] | 38 | ) |
---|
[2579] | 39 | FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED |
---|
[2616] | 40 | NAMES CEGUIBase |
---|
| 41 | PATHS $ENV{CEGUIDIR} |
---|
| 42 | PATH_SUFFIXES lib bin |
---|
[2579] | 43 | ) |
---|
| 44 | FIND_LIBRARY(CEGUI_LIBRARY_DEBUG |
---|
[2616] | 45 | NAMES CEGUIBased CEGUIBase_d |
---|
| 46 | PATHS $ENV{CEGUIDIR} |
---|
| 47 | PATH_SUFFIXES lib bin |
---|
[2579] | 48 | ) |
---|
[1776] | 49 | |
---|
[2616] | 50 | # Inspect CEGUIVersion.h for the version number |
---|
[2583] | 51 | DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h) |
---|
[2573] | 52 | |
---|
[2616] | 53 | # Handle the REQUIRED argument and set CEGUI_FOUND |
---|
| 54 | # Also checks the version requirements if given |
---|
| 55 | FIND_PACKAGE_HANDLE_ADVANCED_ARGS(CEGUI DEFAULT_MSG "${CEGUI_VERSION}" |
---|
[2628] | 56 | CEGUI_LIBRARY_OPTIMIZED |
---|
[2616] | 57 | CEGUI_INCLUDE_DIR |
---|
[2509] | 58 | ) |
---|
[1776] | 59 | |
---|
[2616] | 60 | # Collect optimized and debug libraries |
---|
[2614] | 61 | HANDLE_LIBRARY_TYPES(CEGUI) |
---|
[2579] | 62 | |
---|
[2509] | 63 | MARK_AS_ADVANCED( |
---|
[2616] | 64 | CEGUI_INCLUDE_DIR |
---|
| 65 | CEGUI_LIBRARY_OPTIMIZED |
---|
| 66 | CEGUI_LIBRARY_DEBUG |
---|
[2509] | 67 | ) |
---|
[2616] | 68 | |
---|
| 69 | LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result) |
---|
| 70 | IF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
| 71 | # Also try to find the CEGUILua libraries. |
---|
| 72 | # There would already be libraries in src/ for versions 0.5 and 0.6 |
---|
| 73 | FIND_LIBRARY(CEGUILUA_LIBRARY_OPTIMIZED |
---|
| 74 | NAMES CEGUILua |
---|
| 75 | PATHS $ENV{CEGUIDIR} |
---|
| 76 | PATH_SUFFIXES lib bin |
---|
| 77 | ) |
---|
| 78 | FIND_LIBRARY(CEGUILUA_LIBRARY_DEBUG |
---|
| 79 | NAMES CEGUILuad CEGUILua_d |
---|
| 80 | PATHS $ENV{CEGUIDIR} |
---|
| 81 | PATH_SUFFIXES lib bin |
---|
| 82 | ) |
---|
| 83 | |
---|
| 84 | SET(CEGUILua_FIND_REQUIRED ${CEGUI_FIND_REQUIRED}) |
---|
| 85 | # Handle the REQUIRED argument and set CEGUILUA_FOUND |
---|
| 86 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CEGUILua DEFAULT_MSG |
---|
| 87 | CEGUILUA_LIBRARY_OPTIMIZED |
---|
| 88 | ) |
---|
| 89 | |
---|
| 90 | # Collect optimized and debug libraries |
---|
| 91 | HANDLE_LIBRARY_TYPES(CEGUILUA) |
---|
| 92 | |
---|
| 93 | MARK_AS_ADVANCED( |
---|
| 94 | CEGUILUA_LIBRARY_OPTIMIZED |
---|
| 95 | CEGUILUA_LIBRARY_DEBUG |
---|
| 96 | ) |
---|
| 97 | |
---|
| 98 | ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
| 99 | SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE) |
---|
| 100 | ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
| 101 | |
---|