2009-09-25 23:42:53 +04:00
|
|
|
# - Try to find the Bullet physics engine
|
|
|
|
#
|
|
|
|
# This module defines the following variables
|
|
|
|
#
|
|
|
|
# BULLET_FOUND - Was bullet found
|
|
|
|
# BULLET_INCLUDE_DIRS - the Bullet include directories
|
|
|
|
# BULLET_LIBRARIES - Link to this, by default it includes
|
|
|
|
# all bullet components (Dynamics,
|
|
|
|
# Collision, LinearMath, & SoftBody)
|
|
|
|
#
|
|
|
|
# This module accepts the following variables
|
|
|
|
#
|
|
|
|
# BULLET_ROOT - Can be set to bullet install path or Windows build path
|
|
|
|
#
|
|
|
|
|
2009-09-28 19:45:50 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2009 Kitware, Inc.
|
|
|
|
# Copyright 2009 Philip Lowman <philip@yhbt.com>
|
2009-09-25 23:42:53 +04:00
|
|
|
#
|
2009-09-28 19:45:50 +04:00
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:45:50 +04:00
|
|
|
# License text for the above reference.)
|
2009-09-25 23:42:53 +04:00
|
|
|
|
|
|
|
macro(_FIND_BULLET_LIBRARY _var)
|
|
|
|
find_library(${_var}
|
|
|
|
NAMES
|
|
|
|
${ARGN}
|
2010-11-19 06:24:21 +03:00
|
|
|
HINTS
|
2009-09-25 23:42:53 +04:00
|
|
|
${BULLET_ROOT}
|
|
|
|
${BULLET_ROOT}/out/release8/libs
|
|
|
|
${BULLET_ROOT}/out/debug8/libs
|
|
|
|
PATH_SUFFIXES lib
|
|
|
|
)
|
|
|
|
mark_as_advanced(${_var})
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
macro(_BULLET_APPEND_LIBRARIES _list _release)
|
|
|
|
set(_debug ${_release}_DEBUG)
|
|
|
|
if(${_debug})
|
|
|
|
set(${_list} ${${_list}} optimized ${${_release}} debug ${${_debug}})
|
|
|
|
else()
|
|
|
|
set(${_list} ${${_list}} ${${_release}})
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
find_path(BULLET_INCLUDE_DIR NAMES btBulletCollisionCommon.h
|
2010-11-19 06:24:21 +03:00
|
|
|
HINTS
|
2009-09-25 23:42:53 +04:00
|
|
|
${BULLET_ROOT}/include
|
|
|
|
${BULLET_ROOT}/src
|
2010-11-19 06:24:21 +03:00
|
|
|
PATH_SUFFIXES bullet
|
2009-09-25 23:42:53 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
# Find the libraries
|
|
|
|
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY BulletDynamics)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_d)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_d)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY LinearMath BulletMath)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG LinearMath_d BulletMath_d)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY BulletSoftBody)
|
|
|
|
_FIND_BULLET_LIBRARY(BULLET_SOFTBODY_LIBRARY_DEBUG BulletSoftBody_d)
|
|
|
|
|
|
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
|
|
|
|
# all listed variables are TRUE
|
2010-09-29 00:30:31 +04:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake")
|
2009-09-25 23:42:53 +04:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
|
|
|
|
BULLET_DYNAMICS_LIBRARY BULLET_COLLISION_LIBRARY BULLET_MATH_LIBRARY
|
|
|
|
BULLET_SOFTBODY_LIBRARY BULLET_INCLUDE_DIR)
|
|
|
|
|
|
|
|
set(BULLET_INCLUDE_DIRS ${BULLET_INCLUDE_DIR})
|
|
|
|
if(BULLET_FOUND)
|
|
|
|
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_DYNAMICS_LIBRARY)
|
|
|
|
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_COLLISION_LIBRARY)
|
|
|
|
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_MATH_LIBRARY)
|
|
|
|
_BULLET_APPEND_LIBRARIES(BULLET_LIBRARIES BULLET_SOFTBODY_LIBRARY)
|
|
|
|
endif()
|