Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/archive/lod/cmake/FindCEGUI.cmake @ 10233

Last change on this file since 10233 was 1872, checked in by rgrieder, 16 years ago
  • Modified cmake files to support library finding when using Visual Studio precompiled dependencies
  • Removed vorbisenc executable from library dependency
  • Property svn:eol-style set to native
File size: 4.3 KB
Line 
1# Find CEGUI includes and library
2#
3# This module defines
4#  CEGUI_INCLUDE_DIR
5#  CEGUI_LIBRARIES, the libraries to link against to use CEGUI.
6#  CEGUI_LIB_DIR, the location of the libraries
7#  CEGUI_FOUND, If false, do not try to use CEGUI
8#
9# Created by Matt Williams to find OGRE libraries
10# Copyright © 2007, Matt Williams
11#
12# Modified by Nicolas Schlumberger to find CEGUI libraries
13# and make it run on the Tardis-Infrastucture of the ETH Zurich
14# Copyright 2007, Nicolas Schlumberger
15#
16# Redistribution and use is allowed according to the terms of the BSD license.
17#
18# Several changes and additions by Fabian 'x3n' Landau
19#                 > www.orxonox.net <
20
21IF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
22    SET(CEGUI_FIND_QUIETLY TRUE) # Already in cache, be silent
23ENDIF (CEGUI_LIBRARIES AND CEGUI_INCLUDE_DIR AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
24
25IF (WIN32) #Windows
26    FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
27        ../libs/cegui-0.6.1/include
28        ${DEPENDENCY_DIR}/cegui-0.6.1/include
29    )
30
31    SET(CEGUI_LIBRARIES debug CEGUIBase_d optimized CEGUIBase)
32    FIND_LIBRARY(CEGUI_LIBDIR NAMES ${CEGUI_LIBRARIES} PATHS
33        ../libs/cegui-0.6.1/bin
34        ${DEPENDENCY_DIR}/cegui-0.6.1/lib
35    )
36
37    # Strip the filename from the path
38    IF (CEGUI_LIBDIR)
39        GET_FILENAME_COMPONENT(CEGUI_LIBDIR ${CEGUI_LIBDIR} PATH)
40        SET (CEGUI_LIB_DIR ${CEGUI_LIBDIR} CACHE FILEPATH "")
41    ENDIF (CEGUI_LIBDIR)
42
43#    IF (NOT CEGUI_SCRIPT_LIBDIR)
44#        # Search Lua script module
45#        SET(CEGUI_SCRIPT_LIBRARIES "CEGUILuaScriptModule")
46#        FIND_LIBRARY(CEGUI_SCRIPT_LIBDIR NAMES ${CEGUI_SCRIPT_LIBRARIES} PATHS
47#            ../libs/cegui-0.6.1/bin
48#        )
49#       IF (NOT CEGUI_SCRIPT_LIBDIR)
50#            SET(CEGUI_SCRIPT_LIBRARIES "CEGUILua")
51#            FIND_LIBRARY(CEGUI_SCRIPT_LIBDIR NAMES ${CEGUI_SCRIPT_LIBRARIES} PATHS
52#                ../libs/cegui-0.6.1/bin
53#            )
54#            IF (NOT CEGUI_SCRIPT_LIBDIR)
55#                SET(CEGUI_SCRIPT_LIBRARIES)
56#            ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
57#        ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
58#    ENDIF (NOT CEGUI_SCRIPT_LIBDIR)
59
60#    # Strip the filename from the path
61#    IF (CEGUI_SCRIPT_LIBDIR)
62#        GET_FILENAME_COMPONENT(CEGUI_SCRIPT_LIBDIR ${CEGUI_SCRIPT_LIBDIR} PATH)
63#        SET (CEGUI_SCRIPT_LIB_DIR ${CEGUI_SCRIPT_LIBDIR} CACHE FILEPATH "")
64#    ENDIF (CEGUI_SCRIPT_LIBDIR)
65
66ELSE (WIN32) #Unix
67    FIND_PACKAGE(PkgConfig)
68    PKG_SEARCH_MODULE(CEGUI CEGUI /usr/pack/cegui-0.5.0-sd/i686-debian-linux3.1/lib/pkgconfig/CEGUI.pc) # tardis specific hack
69    SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})
70    SET(CEGUI_LIB_DIR ${CEGUI_LIBDIR})
71    SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
72#    SET(CEGUI_SCRIPT_LIBRARIES "CEGUILuaScriptModule")
73#    SET(CEGUI_SCRIPT_LIB_DIR)
74ENDIF (WIN32)
75
76IF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
77    SET(CEGUI_FOUND TRUE)
78
79    #Do some preparation
80    SEPARATE_ARGUMENTS(CEGUI_INCLUDE_DIR)
81    SEPARATE_ARGUMENTS(CEGUI_LIBRARIES)
82
83    SET(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIR} CACHE PATH "")
84    SET(CEGUI_LIBRARIES ${CEGUI_LIBRARIES} CACHE STRING "")
85    SET(CEGUI_LIB_DIR ${CEGUI_LIB_DIR} CACHE PATH "")
86#    SET(CEGUI_SCRIPT_LIBRARIES ${CEGUI_SCRIPT_LIBRARIES} CACHE PATH "")
87ENDIF (CEGUI_INCLUDE_DIR AND CEGUI_LIBRARIES AND CEGUI_LIB_DIR)# AND CEGUI_SCRIPT_LIBRARIES)
88
89IF (CEGUI_FOUND)
90    IF (NOT CEGUI_FIND_QUIETLY)
91        MESSAGE(STATUS "CEGUI was found.")
92        IF (VERBOSE_FIND)
93            MESSAGE (STATUS "  include path: ${CEGUI_INCLUDE_DIR}")
94            MESSAGE (STATUS "  library path: ${CEGUI_LIB_DIR}")
95            MESSAGE (STATUS "  libraries:    ${CEGUI_LIBRARIES}")
96#            MESSAGE (STATUS "           :    ${CEGUI_SCRIPT_LIBRARIES}")
97        ENDIF (VERBOSE_FIND)
98    ENDIF (NOT CEGUI_FIND_QUIETLY)
99ELSE (CEGUI_FOUND)
100    IF (NOT CEGUI_INCLUDE_DIR)
101        MESSAGE(SEND_ERROR "CEGUI include path was not found.")
102    ENDIF (NOT CEGUI_INCLUDE_DIR)
103    IF (NOT CEGUI_LIB_DIR)
104        MESSAGE(SEND_ERROR "CEGUI library was not found.")
105    ENDIF (NOT CEGUI_LIB_DIR)
106    IF (NOT CEGUI_LIBRARIES)
107        MESSAGE(SEND_ERROR "CEGUI libraries not known.")
108    ENDIF (NOT CEGUI_LIBRARIES)
109#    IF (NOT CEGUI_SCRIPT_LIBRARIES)
110#        MESSAGE(SEND_ERROR "CEGUI Lua script module was not found.")
111#    ENDIF (NOT CEGUI_SCRIPT_LIBRARIES)
112ENDIF (CEGUI_FOUND)
113
Note: See TracBrowser for help on using the repository browser.