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 | |
---|
21 | INCLUDE(DetermineVersion) |
---|
22 | INCLUDE(FindPackageHandleAdvancedArgs) |
---|
23 | INCLUDE(HandleLibraryTypes) |
---|
24 | |
---|
25 | FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h |
---|
26 | PATHS $ENV{CEGUIDIR} |
---|
27 | PATH_SUFFIXES include include/CEGUI |
---|
28 | ) |
---|
29 | FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED |
---|
30 | NAMES CEGUIBase |
---|
31 | PATHS $ENV{CEGUIDIR} |
---|
32 | PATH_SUFFIXES lib bin |
---|
33 | ) |
---|
34 | FIND_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 |
---|
41 | DETERMINE_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 |
---|
45 | FIND_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 |
---|
51 | HANDLE_LIBRARY_TYPES(CEGUI) |
---|
52 | |
---|
53 | MARK_AS_ADVANCED( |
---|
54 | CEGUI_INCLUDE_DIR |
---|
55 | CEGUI_LIBRARY_OPTIMIZED |
---|
56 | CEGUI_LIBRARY_DEBUG |
---|
57 | ) |
---|
58 | |
---|
59 | LIST(FIND CEGUILUA_INTERNAL_SUPPORT "${CEGUI_VERSION}" _find_result) |
---|
60 | IF(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 | |
---|
88 | ELSE(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
89 | SET(CEGUILUA_USE_INTERNAL_LIBRARY TRUE) |
---|
90 | ENDIF(CEGUILUA_USE_EXTERNAL_LIBRARY OR _find_result EQUAL -1) |
---|
91 | |
---|