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 | |
---|
14 | IF (OIS_LIBRARIES AND OIS_INCLUDE_DIR) |
---|
15 | SET(OIS_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
16 | ENDIF (OIS_LIBRARIES AND OIS_INCLUDE_DIR) |
---|
17 | |
---|
18 | IF (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) |
---|
25 | ELSE (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 "") |
---|
31 | ENDIF (WIN32) |
---|
32 | |
---|
33 | #Do some preparation |
---|
34 | SEPARATE_ARGUMENTS(OIS_INCLUDE_DIR) |
---|
35 | SEPARATE_ARGUMENTS(OIS_LIBRARIES) |
---|
36 | |
---|
37 | SET(OIS_INCLUDE_DIR ${OIS_INCLUDE_DIR} CACHE PATH "") |
---|
38 | SET(OIS_LIBRARIES ${OIS_LIBRARIES} CACHE STRING "") |
---|
39 | SET(OIS_LIB_DIR ${OIS_LIB_DIR} CACHE PATH "") |
---|
40 | |
---|
41 | IF (OIS_INCLUDE_DIR AND OIS_LIBRARIES) |
---|
42 | SET(OIS_FOUND TRUE) |
---|
43 | ENDIF (OIS_INCLUDE_DIR AND OIS_LIBRARIES) |
---|
44 | |
---|
45 | IF (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) |
---|
50 | ELSE (OIS_FOUND) |
---|
51 | IF (OIS_FIND_REQUIRED) |
---|
52 | MESSAGE(FATAL_ERROR "Could not find OIS") |
---|
53 | ENDIF (OIS_FIND_REQUIRED) |
---|
54 | ENDIF (OIS_FOUND) |
---|