Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/physics/cmake/FindODE.cmake @ 2103

Last change on this file since 2103 was 1920, checked in by rgrieder, 16 years ago

First attempt to find ODE on a tardis box.

  • Property svn:eol-style set to native
File size: 2.7 KB
Line 
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
18IF (ODE_LIBRARIES AND ODE_INCLUDE_DIR AND ODE_LIB_DIR)
19    SET (ODE_FIND_QUIETLY TRUE) # Already in cache, be silent
20ENDIF (ODE_LIBRARIES AND ODE_INCLUDE_DIR AND ODE_LIB_DIR)
21
22IF (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)
39ELSE (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})
45ENDIF (WIN32)
46
47#Do some preparation
48SEPARATE_ARGUMENTS(ODE_INCLUDE_DIR)
49SEPARATE_ARGUMENTS(ODE_LIBRARIES)
50
51SET (ODE_INCLUDE_DIR ${ODE_INCLUDE_DIR} CACHE PATH "")
52SET (ODE_LIBRARIES ${ODE_LIBRARIES} CACHE STRING "")
53SET (ODE_LIB_DIR ${ODE_LIB_DIR} CACHE PATH "")
54
55IF (ODE_INCLUDE_DIR AND ODE_LIBRARIES AND ODE_LIB_DIR)
56    SET(ODE_FOUND TRUE)
57ENDIF (ODE_INCLUDE_DIR AND ODE_LIBRARIES AND ODE_LIB_DIR)
58
59IF (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)
68ELSE (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)
78ENDIF (ODE_FOUND)
Note: See TracBrowser for help on using the repository browser.