1 | # Find ODE includes and library |
---|
2 | # |
---|
3 | # This module defines |
---|
4 | # ODE_INCLUDE_DIR |
---|
5 | # ODE_LIBRARIES, the libraries to link against to use ODE. |
---|
6 | # ODE_LIB_DIR, the location of the libraries |
---|
7 | # ODE_FOUND, If false, do not try to use ODE |
---|
8 | # |
---|
9 | # Copyright © 2007, Matt Williams (version for FindOGRE) |
---|
10 | # Modified by Nicolas Schlumberger to make it work on the Tardis-Infrastucture of the ETH Zurich |
---|
11 | # |
---|
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 | # Adaption from FindOGRE to FindODE by Reto '1337' Grieder |
---|
16 | # > www.orxonox.net < |
---|
17 | |
---|
18 | IF (ODE_LIBRARIES AND ODE_INCLUDE_DIR AND ODE_LIB_DIR) |
---|
19 | SET (ODE_FIND_QUIETLY TRUE) # Already in cache, be silent |
---|
20 | ENDIF (ODE_LIBRARIES AND ODE_INCLUDE_DIR AND ODE_LIB_DIR) |
---|
21 | |
---|
22 | IF (WIN32) #Windows |
---|
23 | FIND_PATH(ODE_INCLUDE_DIR ode/ode.h |
---|
24 | ../libs/ode-0.10.1/include |
---|
25 | ${DEPENDENCY_DIR}/ode-0.10.1/include |
---|
26 | ) |
---|
27 | |
---|
28 | SET(ODE_LIBRARIES debug ode_singled optimized ode_single) |
---|
29 | FIND_LIBRARY(ODE_LIBDIR NAMES ${ODE_LIBRARIES} PATHS |
---|
30 | ../libs/ode-0.10.1/lib |
---|
31 | ${DEPENDENCY_DIR}/ode-0.10.1/lib |
---|
32 | ) |
---|
33 | |
---|
34 | # Strip the filename from the path |
---|
35 | IF (ODE_LIBDIR) |
---|
36 | GET_FILENAME_COMPONENT(ODE_LIBDIR ${ODE_LIBDIR} PATH) |
---|
37 | SET (ODE_LIB_DIR ${ODE_LIBDIR} CACHE FILEPATH "") |
---|
38 | ENDIF (ODE_LIBDIR) |
---|
39 | ELSE (WIN32) #Unix |
---|
40 | FIND_PACKAGE(PkgConfig) |
---|
41 | PKG_SEARCH_MODULE(ODE ODE /usr/pack/ode-0.9-sd/i686-debian-linux3.1/lib/pkgconfig/ode.pc) # tardis specific hack |
---|
42 | SET(ODE_INCLUDE_DIR ${ODE_INCLUDE_DIRS}) |
---|
43 | SET(ODE_LIB_DIR ${ODE_LIBDIR}) |
---|
44 | SET(ODE_LIBRARIES ${ODE_LIBRARIES}) |
---|
45 | ENDIF (WIN32) |
---|
46 | |
---|
47 | #Do some preparation |
---|
48 | SEPARATE_ARGUMENTS(ODE_INCLUDE_DIR) |
---|
49 | SEPARATE_ARGUMENTS(ODE_LIBRARIES) |
---|
50 | |
---|
51 | SET (ODE_INCLUDE_DIR ${ODE_INCLUDE_DIR} CACHE PATH "") |
---|
52 | SET (ODE_LIBRARIES ${ODE_LIBRARIES} CACHE STRING "") |
---|
53 | SET (ODE_LIB_DIR ${ODE_LIB_DIR} CACHE PATH "") |
---|
54 | |
---|
55 | IF (ODE_INCLUDE_DIR AND ODE_LIBRARIES AND ODE_LIB_DIR) |
---|
56 | SET(ODE_FOUND TRUE) |
---|
57 | ENDIF (ODE_INCLUDE_DIR AND ODE_LIBRARIES AND ODE_LIB_DIR) |
---|
58 | |
---|
59 | IF (ODE_FOUND) |
---|
60 | IF (NOT ODE_FIND_QUIETLY) |
---|
61 | MESSAGE(STATUS "ODE was found.") |
---|
62 | IF (VERBOSE_FIND) |
---|
63 | MESSAGE (STATUS " include path: ${ODE_INCLUDE_DIR}") |
---|
64 | MESSAGE (STATUS " library path: ${ODE_LIB_DIR}") |
---|
65 | MESSAGE (STATUS " libraries: ${ODE_LIBRARIES}") |
---|
66 | ENDIF (VERBOSE_FIND) |
---|
67 | ENDIF (NOT ODE_FIND_QUIETLY) |
---|
68 | ELSE (ODE_FOUND) |
---|
69 | IF (NOT ODE_INCLUDE_DIR) |
---|
70 | MESSAGE(SEND_ERROR "ODE include path was not found.") |
---|
71 | ENDIF (NOT ODE_INCLUDE_DIR) |
---|
72 | IF (NOT ODE_LIB_DIR) |
---|
73 | MESSAGE(SEND_ERROR "ODE library was not found.") |
---|
74 | ENDIF (NOT ODE_LIB_DIR) |
---|
75 | IF (NOT ODE_LIBRARIES) |
---|
76 | MESSAGE(SEND_ERROR "ODE libraries not known.") |
---|
77 | ENDIF (NOT ODE_LIBRARIES) |
---|
78 | ENDIF (ODE_FOUND) |
---|