Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/FindOGRE.cmake @ 1872

Last change on this file since 1872 was 1872, checked in by rgrieder, 15 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: 2.7 KB
Line 
1# Find OGRE includes and library
2#
3# This module defines
4#  OGRE_INCLUDE_DIR
5#  OGRE_LIBRARIES, the libraries to link against to use OGRE.
6#  OGRE_LIB_DIR, the location of the libraries
7#  OGRE_FOUND, If false, do not try to use OGRE
8#
9# Copyright © 2007, Matt Williams
10# Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich
11#
12# Redistribution and use is allowed according to the terms of the BSD license.
13#
14# Several changes and additions by Fabian 'x3n' Landau
15#                 > www.orxonox.net <
16
17IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR)
18    SET (OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
19ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR AND OGRE_LIB_DIR)
20
21IF (WIN32) #Windows
22    FIND_PATH(OGRE_INCLUDE_DIR Ogre.h
23        ../libs/ogre/OgreMain/include
24        ${DEPENDENCY_DIR}/ogre-1.4.9/include
25    )
26
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    )
32
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)
38ELSE (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})
44ENDIF (WIN32)
45
46#Do some preparation
47SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
48SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
49
50SET (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
51SET (OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
52SET (OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
53
54IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR)
55    SET(OGRE_FOUND TRUE)
56ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR)
57
58IF (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)
67ELSE (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)
77ENDIF (OGRE_FOUND)
Note: See TracBrowser for help on using the repository browser.