Changeset 1776 for code/trunk/cmake/FindOGRE.cmake
- Timestamp:
- Sep 13, 2008, 9:32:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/cmake/FindOGRE.cmake
r1505 r1776 11 11 # 12 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 < 13 16 14 IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR )15 SET (OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent16 ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR )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) 17 20 18 21 IF (WIN32) #Windows 19 MESSAGE(STATUS "Looking for OGRE") 20 SET(OGRE_INCLUDE_DIR ../libs/ogre/OgreMain/include) 21 SET(OGRE_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libs/ogre/Samples/Common/bin/Release) 22 FIND_PATH(OGRE_INCLUDE_DIR Ogre.h 23 ../libs/ogre/OgreMain/include 24 ) 25 22 26 SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain) 27 FIND_LIBRARY(OGRE_LIBDIR NAMES ${OGRE_LIBRARIES} PATHS 28 ../libs/ogre/Samples/Common/bin/Release 29 ) 30 31 # Strip the filename from the path 32 IF (OGRE_LIBDIR) 33 GET_FILENAME_COMPONENT(OGRE_LIBDIR ${OGRE_LIBDIR} PATH) 34 SET (OGRE_LIB_DIR ${OGRE_LIBDIR} CACHE FILEPATH "") 35 ENDIF (OGRE_LIBDIR) 23 36 ELSE (WIN32) #Unix 24 37 FIND_PACKAGE(PkgConfig) … … 26 39 SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS}) 27 40 SET(OGRE_LIB_DIR ${OGRE_LIBDIR}) 28 SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")41 SET(OGRE_LIBRARIES ${OGRE_LIBRARIES}) 29 42 ENDIF (WIN32) 30 43 … … 33 46 SEPARATE_ARGUMENTS(OGRE_LIBRARIES) 34 47 35 SET (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")36 SET (OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")37 SET (OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")48 SET (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "") 49 SET (OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "") 50 SET (OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "") 38 51 39 IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES )52 IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR) 40 53 SET(OGRE_FOUND TRUE) 41 ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES )54 ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES AND OGRE_LIB_DIR) 42 55 43 56 IF (OGRE_FOUND) 44 57 IF (NOT OGRE_FIND_QUIETLY) 45 MESSAGE(STATUS " libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}") 46 MESSAGE(STATUS " includes : ${OGRE_INCLUDE_DIR}") 58 MESSAGE(STATUS "Ogre was found.") 59 IF (VERBOSE_FIND) 60 MESSAGE (STATUS " include path: ${OGRE_INCLUDE_DIR}") 61 MESSAGE (STATUS " library path: ${OGRE_LIB_DIR}") 62 MESSAGE (STATUS " libraries: ${OGRE_LIBRARIES}") 63 ENDIF (VERBOSE_FIND) 47 64 ENDIF (NOT OGRE_FIND_QUIETLY) 48 65 ELSE (OGRE_FOUND) 49 IF (OGRE_FIND_REQUIRED) 50 MESSAGE(FATAL_ERROR "Could not find OGRE") 51 ENDIF (OGRE_FIND_REQUIRED) 66 IF (NOT OGRE_INCLUDE_DIR) 67 MESSAGE(SEND_ERROR "Ogre include path was not found.") 68 ENDIF (NOT OGRE_INCLUDE_DIR) 69 IF (NOT OGRE_LIB_DIR) 70 MESSAGE(SEND_ERROR "Ogre library was not found.") 71 ENDIF (NOT OGRE_LIB_DIR) 72 IF (NOT OGRE_LIBRARIES) 73 MESSAGE(SEND_ERROR "Ogre libraries not known.") 74 ENDIF (NOT OGRE_LIBRARIES) 52 75 ENDIF (OGRE_FOUND)
Note: See TracChangeset
for help on using the changeset viewer.