Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 14, 2009, 10:53:45 PM (15 years ago)
Author:
rgrieder
Message:

Merged buildsystem2 to buildsystem3.

Note: Bare merge, just resolved conflicts. To testing, no nothing.

Location:
code/branches/buildsystem3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3

  • code/branches/buildsystem3/cmake/FindOGRE.cmake

    r1872 r2664  
    33# This module defines
    44#  OGRE_INCLUDE_DIR
    5 #  OGRE_LIBRARIES, the libraries to link against to use OGRE.
    6 #  OGRE_LIB_DIR, the location of the libraries
     5#  OGRE_LIBRARY, the library to link against to use OGRE.
    76#  OGRE_FOUND, If false, do not try to use OGRE
    87#
    98# Copyright © 2007, Matt Williams
    10 # Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich
     9# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture
     10# of the ETH Zurich (removed later on)
    1111#
    1212# Redistribution and use is allowed according to the terms of the BSD license.
    1313#
    1414# Several changes and additions by Fabian 'x3n' Landau
     15# Lots of simplifications by Adrian Friedli
     16# Version checking by Reto Grieder
    1517#                 > www.orxonox.net <
    1618
    17 IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR)
    18     SET (OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
    19 ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR)
     19INCLUDE(DetermineVersion)
     20INCLUDE(FindPackageHandleAdvancedArgs)
     21INCLUDE(HandleLibraryTypes)
    2022
    21 IF (WIN32) #Windows
    22     FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
    23         ../libs/ogre/OgreMain/include
    24         ${DEPENDENCY_DIR}/ogre-1.4.9/include
    25     )
     23FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
     24  PATHS $ENV{OGRE_HOME}
     25  PATH_SUFFIXES include include/OGRE Ogre.framework/Headers
     26)
     27FIND_LIBRARY(OGRE_LIBRARY_OPTIMIZED
     28  NAMES OgreMain Ogre
     29  PATHS $ENV{OGRE_HOME}
     30  PATH_SUFFIXES lib bin/Release bin/release Release release
     31)
     32FIND_LIBRARY(OGRE_LIBRARY_DEBUG
     33  NAMES OgreMaind OgreMain_d OgreMainD OgreMain_D Ogred Ogre_d OgreD Ogre_d
     34  PATHS $ENV{OGRE_HOME}
     35  PATH_SUFFIXES lib bin/Debug bin/debug Debug debug Versions/A
     36)
    2637
    27     SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
    28     FIND_LIBRARY(OGRE_LIBDIR NAMES ${OGRE_LIBRARIES} PATHS
    29         ../libs/ogre/Samples/Common/bin/Release
    30         ${DEPENDENCY_DIR}/ogre-1.4.9/lib
    31     )
     38# Inspect OgrePrerquisites.h for the version number
     39DETERMINE_VERSION(OGRE ${OGRE_INCLUDE_DIR}/OgrePrerequisites.h)
    3240
    33     # Strip the filename from the path
    34     IF (OGRE_LIBDIR)
    35         GET_FILENAME_COMPONENT(OGRE_LIBDIR ${OGRE_LIBDIR} PATH)
    36         SET (OGRE_LIB_DIR ${OGRE_LIBDIR} CACHE FILEPATH "")
    37     ENDIF (OGRE_LIBDIR)
    38 ELSE (WIN32) #Unix
    39     FIND_PACKAGE(PkgConfig)
    40     PKG_SEARCH_MODULE(OGRE OGRE /usr/pack/ogre-1.4.5-sd/i686-debian-linux3.1/lib/pkgconfig/OGRE.pc) # tardis specific hack
    41     SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
    42     SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
    43     SET(OGRE_LIBRARIES ${OGRE_LIBRARIES})
    44 ENDIF (WIN32)
     41# Handle the REQUIRED argument and set OGRE_FOUND
     42# Also check the version requirements
     43FIND_PACKAGE_HANDLE_ADVANCED_ARGS(OGRE DEFAULT_MSG ${OGRE_VERSION}
     44  OGRE_LIBRARY_OPTIMIZED
     45  OGRE_INCLUDE_DIR
     46)
    4547
    46 #Do some preparation
    47 SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
    48 SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
     48# Collect optimized and debug libraries
     49HANDLE_LIBRARY_TYPES(OGRE)
    4950
    50 SET (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
    51 SET (OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
    52 SET (OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
    53 
    54 IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR)
    55     SET(OGRE_FOUND TRUE)
    56 ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR)
    57 
    58 IF (OGRE_FOUND)
    59     IF (NOT OGRE_FIND_QUIETLY)
    60         MESSAGE(STATUS "Ogre was found.")
    61         IF (VERBOSE_FIND)
    62             MESSAGE (STATUS "  include path: ${OGRE_INCLUDE_DIR}")
    63             MESSAGE (STATUS "  library path: ${OGRE_LIB_DIR}")
    64             MESSAGE (STATUS "  libraries:    ${OGRE_LIBRARIES}")
    65         ENDIF (VERBOSE_FIND)
    66     ENDIF (NOT OGRE_FIND_QUIETLY)
    67 ELSE (OGRE_FOUND)
    68     IF (NOT OGRE_INCLUDE_DIR)
    69         MESSAGE(SEND_ERROR "Ogre include path was not found.")
    70     ENDIF (NOT OGRE_INCLUDE_DIR)
    71     IF (NOT OGRE_LIB_DIR)
    72         MESSAGE(SEND_ERROR "Ogre library was not found.")
    73     ENDIF (NOT OGRE_LIB_DIR)
    74     IF (NOT OGRE_LIBRARIES)
    75         MESSAGE(SEND_ERROR "Ogre libraries not known.")
    76     ENDIF (NOT OGRE_LIBRARIES)
    77 ENDIF (OGRE_FOUND)
     51MARK_AS_ADVANCED(
     52  OGRE_INCLUDE_DIR
     53  OGRE_LIBRARY_OPTIMIZED
     54  OGRE_LIBRARY_DEBUG
     55)
Note: See TracChangeset for help on using the changeset viewer.