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 | |
---|
18 | IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR) |
---|
19 | SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
20 | ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR) |
---|
21 | |
---|
22 | IF (WIN32) #Windows |
---|
23 | MESSAGE(STATUS "Looking for OIS") |
---|
24 | SET(OISSDK $ENV{OIS_HOME}) |
---|
25 | STRING(REGEX REPLACE "[\\]" "/" OISSDK "${OISSDK}" ) |
---|
26 | SET(OIS_INCLUDE_DIR ${OISSDK}/include) |
---|
27 | SET(OIS_LIB_DIR ${OISSDK}/lib) |
---|
28 | SET(OIS_LIBRARIES debug OgreMain_d optimized OgreMain) |
---|
29 | ELSE (WIN32) #Unix |
---|
30 | FIND_PACKAGE(PkgConfig) |
---|
31 | PKG_SEARCH_MODULE(OIS OIS /usr/pack/ois-1.0-sd/i686-debian-linux3.1/lib/pkgconfig/OIS.pc) # tardis specific hack |
---|
32 | SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIRS}) |
---|
33 | SET(OIS_LIB_DIR ${OIS_LIBDIR}) |
---|
34 | SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "") |
---|
35 | ENDIF (WIN32) |
---|
36 | |
---|
37 | #Do some preparation |
---|
38 | SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR) |
---|
39 | SEPARATE_ARGUMENTS(OIS_LIBRARIES) |
---|
40 | |
---|
41 | SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "") |
---|
42 | SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "") |
---|
43 | SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "") |
---|
44 | |
---|
45 | IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES) |
---|
46 | SET(OIS_FOUND TRUE) |
---|
47 | ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES) |
---|
48 | |
---|
49 | IF (OIS_FOUND) |
---|
50 | IF (NOT OIS_FIND_QUIETLY) |
---|
51 | MESSAGE(STATUS " libraries : ${OIS_LIBRARIES} from ${OIS_LIB_DIR}") |
---|
52 | MESSAGE(STATUS " includes : ${OIS_INCLUDE_DIR}") |
---|
53 | ENDIF (NOT OIS_FIND_QUIETLY) |
---|
54 | ELSE (OIS_FOUND) |
---|
55 | IF (OIS_FIND_REQUIRED) |
---|
56 | MESSAGE(FATAL_ERROR "Could not find OIS") |
---|
57 | ENDIF (OIS_FIND_REQUIRED) |
---|
58 | ENDIF (OIS_FOUND) |
---|