1 # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
8 Try to find the Bullet physics engine
14 This module defines the following variables
20 BULLET_FOUND - Was bullet found
21 BULLET_INCLUDE_DIRS - the Bullet include directories
22 BULLET_LIBRARIES - Link to this, by default it includes
23 all bullet components (Dynamics,
24 Collision, LinearMath, & SoftBody)
30 This module accepts the following variables
36 BULLET_ROOT - Can be set to bullet install path or Windows build path
37 #]=======================================================================]
39 macro(_FIND_BULLET_LIBRARY _var)
45 ${BULLET_ROOT}/lib/Release
46 ${BULLET_ROOT}/lib/Debug
47 ${BULLET_ROOT}/out/release8/libs
48 ${BULLET_ROOT}/out/debug8/libs
51 mark_as_advanced(${_var})
54 macro(_BULLET_APPEND_LIBRARIES _list _release)
55 set(_debug ${_release}_DEBUG)
57 set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}})
59 set(${_list} ${${_list}} ${${_release}})
63 find_path(BULLET_INCLUDE_DIR NAMES btBulletCollisionCommon.h
65 ${BULLET_ROOT}/include
72 _FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY BulletDynamics)
73 _FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_Debug BulletDynamics_d)
74 _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision)
75 _FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_Debug BulletCollision_d)
76 _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY BulletMath LinearMath)
77 _FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_Debug LinearMath_d)
78 _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody)
79 _FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_Debug BulletSoftBody_d)
82 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
83 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
84 BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY
85 BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
87 set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR})
89 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY)
90 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY)
91 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
92 _BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_SOFTBODY_LIBRARY)