Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/cmake/FindOIS.cmake @ 114

Last change on this file since 114 was 114, checked in by anonymous, 17 years ago

nicolasc: minor changes in .camke

File size: 2.0 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# Created by Matt Williams to find OGRE libraries
10# Copyright © 2007, Matt Williams
11#
12# Modified by Nicolas Schlumberger to find OIS libraries
13# and make it run on the Tardis-Infrastucture of the ETH Zurich
14# Copyright 2007, Nicolas Schlumberger
15#
16# Redistribution and use is allowed according to the terms of the BSD license.
17
18IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
19    SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent
20ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR)
21
22## TODO: test windows part
23# windows part is currently untested. (28.Oct.2007)
24IF (WIN32) #Windows
25    MESSAGE(STATUS "Looking for OIS")
26    SET(OISSDK $ENV{OIS_HOME})
27    STRING(REGEX REPLACE "[\\]" "/" OISSDK "${OISSDK}" )
28    SET(OIS_INCLUDE_DIR ${OISSDK}/include)
29    SET(OIS_LIB_DIR ${OISSDK}/lib)
30    #SET(OIS_LIBRARIES debug OgreMain_d optimized OgreMain)
31ELSE (WIN32) #Unix
32    FIND_PACKAGE(PkgConfig)
33    PKG_SEARCH_MODULE(OIS OIS /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc) # tardis specific hack
34    SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS})
35    SET(OIS_LIB_DIR ${OIS_LIBDIR})
36    SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
37ENDIF (WIN32)
38
39#Do some preparation
40SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR)
41SEPARATE_ARGUMENTS(OIS_LIBRARIES)
42
43SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "")
44SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "")
45SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "")
46
47IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
48    SET(OIS_FOUND TRUE)
49ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES)
50
51IF (OIS_FOUND)
52    IF (NOT OIS_FIND_QUIETLY)
53        MESSAGE(STATUS "  libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}")
54        MESSAGE(STATUS "  includes  : ${OIS_INCLUDE_DIR}")
55    ENDIF (NOT OIS_FIND_QUIETLY)
56ELSE (OIS_FOUND)
57    IF (OIS_FIND_REQUIRED)
58        MESSAGE(FATAL_ERROR "Could not find OIS")
59    ENDIF (OIS_FIND_REQUIRED)
60ENDIF (OIS_FOUND)
Note: See TracBrowser for help on using the repository browser.