1 # - Try to find the Bullet physics engine
3 # This module defines the following variables
5 # BULLET_FOUND - Was bullet found
6 # BULLET_INCLUDE_DIRS - the Bullet include directories
7 # BULLET_LIBRARIES - Link to this, by default it includes
8 # all bullet components (Dynamics,
9 # Collision, LinearMath, & SoftBody)
11 # This module accepts the following variables
13 # BULLET_ROOT - Can be set to bullet install path or Windows build path
16 #=============================================================================
17 # Copyright 2009 Kitware, Inc.
18 # Copyright 2009 Philip Lowman <philip@yhbt.com>
20 # Distributed under the OSI-approved BSD License (the "License");
21 # see accompanying file Copyright.txt for details.
23 # This software is distributed WITHOUT ANY WARRANTY; without even the
24 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
25 # See the License for more information.
26 #=============================================================================
27 # (To distribute this file outside of CMake, substitute the full
28 # License text for the above reference.)
30 macro(_FIND_BULLET_LIBRARY _var)
36 ${BULLET_ROOT}/out/release8/libs
37 ${BULLET_ROOT}/out/debug8/libs
40 mark_as_advanced(${_var})
43 macro(_BULLET_APPEND_LIBRARIES _list _release)
44 set(_debug ${_release}_DEBUG)
46 set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}})
48 set(${_list} ${${_list}} ${${_release}})
52 find_path(BULLET_INCLUDE_DIR NAMES btBulletCollisionCommon.h
54 ${BULLET_ROOT}/include
61 _FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY BulletDynamics)
62 _FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_Debug BulletDynamics_d)
63 _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision)
64 _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_Debug BulletCollision_d)
65 _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY BulletMath LinearMath)
66 _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_Debug LinearMath_d)
67 _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody)
68 _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_Debug BulletSoftBody_d)
71 # handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
72 # all listed variables are TRUE
73 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
74 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
75 BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY
76 BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
78 set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR})
80 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY)
81 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY)
82 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
83 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_SOFTBODY_LIBRARY)