Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 25, 2011, 3:07:17 AM (14 years ago)
Author:
rgrieder
Message:

Applied C++ code changes to compile Orxonox with CEGUI 0.7 (does not run yet).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/cmake/tools/FindCEGUI.cmake

    r7941 r7960  
    2626#                 > www.orxonox.net <
    2727
     28INCLUDE(CompareVersionStrings)
    2829INCLUDE(DetermineVersion)
    2930INCLUDE(FindPackageHandleAdvancedArgs)
    3031INCLUDE(HandleLibraryTypes)
    3132
    32 # Find CEGUI library
     33# Find headers
    3334FIND_PATH(CEGUI_INCLUDE_DIR CEGUI.h
    3435  PATHS $ENV{CEGUIDIR}
    3536  PATH_SUFFIXES include include/CEGUI CEGUI.framework/Headers
    3637)
     38
     39# Inspect CEGUIVersion.h for the version number
     40DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     41
     42# Find CEGUI library
    3743FIND_LIBRARY(CEGUI_LIBRARY_OPTIMIZED
    3844  NAMES CEGUIBase CEGUI
     
    7278)
    7379
    74 # Inspect CEGUIVersion.h for the version number
    75 DETERMINE_VERSION(CEGUI ${CEGUI_INCLUDE_DIR}/CEGUIVersion.h)
     80# Newer versions of CEGUI have the renderer for OGRE shipped with them
     81COMPARE_VERSION_STRINGS("${CEGUI_VERSION}" "0.7" _version_compare TRUE)
     82IF(_version_compare GREATER -1)
     83  # Find CEGUI OGRE Renderer libraries
     84  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     85    NAMES CEGUIOgreRenderer
     86    PATHS $ENV{CEGUIDIR}
     87    PATH_SUFFIXES lib bin
     88  )
     89  FIND_LIBRARY(CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
     90    NAMES CEGUIOgreRendererd CEGUIOgreRenderer_d
     91    PATHS $ENV{CEGUIDIR}
     92    PATH_SUFFIXES lib bin
     93  )
     94  SET(CEGUI_OGRE_RENDERER_LIBRARY_NAME CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED)
     95ELSE()
     96  SET(CEGUI_OGRE_RENDERER_BUILD_REQUIRED TRUE)
     97ENDIF()
    7698
    7799# Handle the REQUIRED argument and set CEGUI_FOUND
     
    82104  CEGUILUA_LIBRARY_OPTIMIZED
    83105  CEGUI_TOLUA_LIBRARY_OPTIMIZED
     106  ${CEGUI_OGRE_RENDERER_LIBRARY_NAME}
    84107)
    85108
     
    88111HANDLE_LIBRARY_TYPES(CEGUILUA)
    89112HANDLE_LIBRARY_TYPES(CEGUI_TOLUA)
     113IF(NOT CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
     114  HANDLE_LIBRARY_TYPES(CEGUI_OGRE_RENDERER)
     115ENDIF()
    90116
    91117MARK_AS_ADVANCED(
     
    97123  CEGUI_TOLUA_LIBRARY_OPTIMIZED
    98124  CEGUI_TOLUA_LIBRARY_DEBUG
     125  CEGUI_OGRE_RENDERER_LIBRARY_OPTIMIZED
     126  CEGUI_OGRE_RENDERER_LIBRARY_DEBUG
    99127)
Note: See TracChangeset for help on using the changeset viewer.