Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/xml-old/cmake/FindOIS.cmake @ 183

Last change on this file since 183 was 89, checked in by bknecht, 17 years ago

merge of mainloop branch to trunk

File size: 1.8 KB
Line 
1# Find OIS includes and library
2#
3# This module defines
4#  OIS_INCLUDE_DIR
5#  OIS_LIBRARIES, the libraries to link against to use OIS.
6#  OIS_LIB_DIR, the location of the libraries
7#  OIS_FOUND, If false, do not try to use OIS
8#
9# Copyright © 2007, Matt Williams
10# Modified by Nicolas Schlumber
11#
12# Redistribution and use is allowed according to the terms of the BSD license.
13
14IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
15    SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent
16ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
17
18IF (WIN32) #Windows
19    MESSAGE(STATUS "Looking for OIS")
20    SET(OISSDK $ENV{OIS_HOME})
21    STRING(REGEX REPLACE "[\\]" "/" OISSDK "${OISSDK}" )
22    SET(OIS_INCLUDE_DIR ${OISSDK}/include)
23    SET(OIS_LIB_DIR ${OISSDK}/lib)
24    SET(OIS_LIBRARIES debug OgreMain_d optimized OgreMain)
25ELSE (WIN32) #Unix
26    FIND_PACKAGE(PkgConfig)
27    PKG_SEARCH_MODULE(OIS OIS /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc) # tardis specific hack
28    SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
29    SET(OIS_LIB_DIR ${OIS_LIBDIR})
30    SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
31ENDIF (WIN32)
32
33#Do some preparation
34SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR)
35SEPARATE_ARGUMENTS(OIS_LIBRARIES)
36
37SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "")
38SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
39SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "")
40
41IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
42    SET(OIS_FOUND TRUE)
43ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
44
45IF (OIS_FOUND)
46    IF (NOT OIS_FIND_QUIETLY)
47        MESSAGE(STATUS "  libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}")
48        MESSAGE(STATUS "  includes  : ${OIS_INCLUDE_DIR}")
49    ENDIF (NOT OIS_FIND_QUIETLY)
50ELSE (OIS_FOUND)
51    IF (OIS_FIND_REQUIRED)
52        MESSAGE(FATAL_ERROR "Could not find OIS")
53    ENDIF (OIS_FIND_REQUIRED)
54ENDIF (OIS_FOUND)
Note: See TracBrowser for help on using the repository browser.