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 distributed 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
60
_FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY BulletDynamics)
61
_FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_d)
62
_FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision)
63
_FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_d)
64
_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY LinearMath BulletMath)
65
_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG LinearMath_d BulletMath_d)
66
_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody)
67
_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_d)
70
# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
71
# all listed variables are TRUE
72
include(FindPackageHandleStandardArgs)
73
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
74
BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY
75
BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
77
set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR})
79
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY)
80
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY)
81
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
82
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_SOFTBODY_LIBRARY)