Skip to content

Commit

Permalink
bullet 2.82
Browse files Browse the repository at this point in the history
  • Loading branch information
kripken committed Apr 18, 2014
1 parent ed1974d commit 2018d36
Show file tree
Hide file tree
Showing 522 changed files with 35,154 additions and 118,052 deletions.
8 changes: 3 additions & 5 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,8 @@ following steps:
ok.


TODO
====
Upstream Version
================

* The HEAP memory space may not be implemented as a flat object in
all JS engines, especially when we use a lot of memory. Need to
investigate this.
Bullet 2.82

25 changes: 25 additions & 0 deletions bullet/BulletConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- cmake -*-
#
# BulletConfig.cmake(.in)
#

# Use the following variables to compile and link against Bullet:
# BULLET_FOUND - True if Bullet was found on your system
# BULLET_USE_FILE - The file making Bullet usable
# BULLET_DEFINITIONS - Definitions needed to build with Bullet
# BULLET_INCLUDE_DIR - Directory where Bullet-C-Api.h can be found
# BULLET_INCLUDE_DIRS - List of directories of Bullet and it's dependencies
# BULLET_LIBRARIES - List of libraries to link against Bullet library
# BULLET_LIBRARY_DIRS - List of directories containing Bullet' libraries
# BULLET_ROOT_DIR - The base directory of Bullet
# BULLET_VERSION_STRING - A human-readable string containing the version

set ( BULLET_FOUND 1 )
set ( BULLET_USE_FILE "@BULLET_USE_FILE@" )
set ( BULLET_DEFINITIONS "@BULLET_DEFINITIONS@" )
set ( BULLET_INCLUDE_DIR "@INCLUDE_INSTALL_DIR@" )
set ( BULLET_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@" )
set ( BULLET_LIBRARIES "@BULLET_LIBRARIES@" )
set ( BULLET_LIBRARY_DIRS "@LIB_DESTINATION@" )
set ( BULLET_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" )
set ( BULLET_VERSION_STRING "@BULLET_VERSION@" )
Binary file added bullet/Bullet_User_Manual.pdf
Binary file not shown.
225 changes: 163 additions & 62 deletions bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
SET(MSVC_INCREMENTAL_DEFAULT ON)

PROJECT(BULLET_PHYSICS)
SET(BULLET_VERSION 2.78)
SET(BULLET_VERSION 2.82)

IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
Expand All @@ -22,11 +22,7 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")

OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF)
OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON)
OPTION(USE_MULTITHREADED_BENCHMARK "Use Multithreaded Benchmark" OFF)

IF (USE_MULTITHREADED_BENCHMARK)
ADD_DEFINITIONS(-DUSE_PARALLEL_SOLVER_BENCHMARK -DUSE_PARALLEL_DISPATCHER_BENCHMARK)
ENDIF()

OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF)
OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
Expand All @@ -42,14 +38,141 @@ IF (USE_CUSTOM_VECTOR_MATH)
ENDIF(WIN32)
ENDIF(USE_CUSTOM_VECTOR_MATH)

IF (MSVC)
FIND_PATH(DIRECTX_SDK_BASE_DIR Include/D3D11.h PATH $ENV{DXSDK_DIR} )
IF(DIRECTX_SDK_BASE_DIR)
OPTION(USE_DX11 "Use DirectX 11" ON)

IF (APPLE OR MSVC)
OPTION(BUILD_MULTITHREADING "Use BulletMultiThreading" ON)
ELSE()
OPTION(BUILD_MULTITHREADING "Use BulletMultiThreading" OFF)
ENDIF()

IF (BUILD_MULTITHREADING)
OPTION(USE_MULTITHREADED_BENCHMARK "Use Multithreaded Benchmark" OFF)
IF (USE_MULTITHREADED_BENCHMARK)
ADD_DEFINITIONS(-DUSE_PARALLEL_SOLVER_BENCHMARK -DUSE_PARALLEL_DISPATCHER_BENCHMARK)
ENDIF(USE_MULTITHREADED_BENCHMARK)

IF (MSVC OR APPLE)
OPTION(BUILD_MINICL_OPENCL_DEMOS "Build OpenCL demos for MiniCL (Generic CPU)" ON)
ELSE()
OPTION(USE_DX11 "Use DirectX 11" OFF)
ENDIF()
ENDIF(MSVC)
OPTION(BUILD_MINICL_OPENCL_DEMOS "Build OpenCL demos for MiniCL (Generic CPU)" OFF)
ENDIF(MSVC OR APPLE)

IF(MSVC)
FIND_PATH(DIRECTX_SDK_BASE_DIR Include/D3D11.h PATH $ENV{DXSDK_DIR} )
IF(DIRECTX_SDK_BASE_DIR)
OPTION(USE_DX11 "Use DirectX 11" ON)
ELSE()
OPTION(USE_DX11 "Use DirectX 11" OFF)
ENDIF()

FIND_PATH(AMD_OPENCL_BASE_DIR include/CL/cl.h PATH $ENV{ATISTREAMSDKROOT} $ENV{AMDAPPSDKROOT} )
IF(AMD_OPENCL_BASE_DIR)
#AMD adds an extras slash at the end of the ATISTREAMSDKROOT variable
SET(AMD_OPENCL_INCLUDES ${AMD_OPENCL_BASE_DIR}/include )
MESSAGE("AMD OPENCL SDK FOUND")
IF (CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBPATH ${AMD_OPENCL_BASE_DIR}/lib/x86_64 )
ELSE(CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBPATH ${AMD_OPENCL_BASE_DIR}/lib/x86 )
ENDIF(CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBRARY ${CMAKE_ATISTREAMSDK_LIBPATH}/OpenCL.lib )
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" ON)
IF (CMAKE_CL_64)
SET(CMAK_GLEW_LIBRARY
${BULLET_PHYSICS_SOURCE_DIR}/Glut/glew64s.lib )
ELSE(CMAKE_CL_64)
SET(CMAK_GLEW_LIBRARY ${BULLET_PHYSICS_SOURCE_DIR}/Glut/glew32s.lib )
ENDIF(CMAKE_CL_64)
ELSE()
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" OFF)
ENDIF()

FIND_PATH(INTEL_OPENCL_BASE_DIR include/CL/cl.h PATH $ENV{INTELOCLSDKROOT} )
IF(INTEL_OPENCL_BASE_DIR)
SET(INTEL_OPENCL_INCLUDES ${INTEL_OPENCL_BASE_DIR}/include )
MESSAGE("INTEL OPENCL SDK FOUND")
MESSAGE(${INTEL_OPENCL_INCLUDES})
IF (CMAKE_CL_64)
SET(CMAKE_INTELOCLSDK_LIBPATH ${INTEL_OPENCL_BASE_DIR}/lib/x64 )
ELSE(CMAKE_CL_64)
SET(CMAKE_INTELOCLSDK_LIBPATH ${INTEL_OPENCL_BASE_DIR}/lib/x86 )
ENDIF(CMAKE_CL_64)
SET(INTEL_OPENCL_LIBRARIES ${CMAKE_INTELOCLSDK_LIBPATH}/OpenCL.lib)
OPTION(BUILD_INTEL_OPENCL_DEMOS "Build OpenCL demos for Intel (CPU)" ON)
ELSE()
OPTION(BUILD_INTEL_OPENCL_DEMOS "Build OpenCL demos for Intel (CPU)" OFF)
ENDIF()

FIND_PATH(NVIDIA_OPENCL_BASE_DIR include/CL/cl.h PATH $ENV{CUDA_PATH} )
IF(NVIDIA_OPENCL_BASE_DIR)
SET(NVIDIA_OPENCL_INCLUDES ${NVIDIA_OPENCL_BASE_DIR}/include )
MESSAGE("NVIDIA OPENCL SDK FOUND")
MESSAGE(${NVIDIA_OPENCL_INCLUDES})
IF (CMAKE_CL_64)
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/lib/x64 )
ELSE(CMAKE_CL_64)
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/lib/Win32 )
ENDIF(CMAKE_CL_64)
SET(NVIDIA_OPENCL_LIBRARIES ${CMAKE_NVSDKCOMPUTE_LIBPATH}/OpenCL.lib)

OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" ON)
ELSE()
OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" OFF)
ENDIF()
ELSE(MSVC)
FIND_PATH(AMD_OPENCL_BASE_DIR include/CL/cl.h PATH $ENV{ATISTREAMSDKROOT} $ENV{AMDAPPSDKROOT} )
IF(AMD_OPENCL_BASE_DIR)
#AMD adds an extras slash at the end of the ATISTREAMSDKROOT variable
SET(AMD_OPENCL_INCLUDES ${AMD_OPENCL_BASE_DIR}/include )
MESSAGE("AMD OPENCL SDK FOUND")
MESSAGE(${AMD_OPENCL_INCLUDES})
IF (CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBPATH ${AMD_OPENCL_BASE_DIR}/lib/x86_64 )
ELSE(CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBPATH ${AMD_OPENCL_BASE_DIR}/lib/x86 )
ENDIF(CMAKE_CL_64)
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" ON)
SET(CMAKE_ATISTREAMSDK_LIBRARY OpenCL )
ELSE()
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" OFF)
ENDIF(AMD_OPENCL_BASE_DIR)

FIND_PATH(INTEL_OPENCL_INCLUDES CL/cl.h)
FIND_PATH(INTEL_OPENCL_ICD_CFG intelocl64.icd /etc/OpenCL/vendors)
FIND_LIBRARY(INTEL_OPENCL_LIBRARIES OpenCL PATH /usr/lib64)
IF (INTEL_OPENCL_INCLUDES AND INTEL_OPENCL_LIBRARIES AND INTEL_OPENCL_ICD_CFG)
MESSAGE("INTEL OPENCL SDK FOUND")
MESSAGE(${INTEL_OPENCL_LIBRARIES})
OPTION(BUILD_INTEL_OPENCL_DEMOS "Build OpenCL demos for Intel (CPU)" ON)
ELSE ()
MESSAGE("INTEL OPENCL NOT FOUND")
OPTION(BUILD_INTEL_OPENCL_DEMOS "Build OpenCL demos for Intel (CPU)" OFF)
ENDIF ()


FIND_PATH(NVIDIA_OPENCL_INCLUDES CL/cl.h)
FIND_PATH(NVIDIA_OPENCL_ICD_CFG nvidia.icd /etc/OpenCL/vendors)
FIND_LIBRARY(NVIDIA_OPENCL_LIBRARIES OpenCL PATH /usr/lib64 /usr/local/lib)
IF (NVIDIA_OPENCL_INCLUDES AND NVIDIA_OPENCL_LIBRARIES AND NVIDIA_OPENCL_ICD_CFG)
MESSAGE("NVidia OPENCL FOUND")
MESSAGE(${NVIDIA_OPENCL_LIBRARIES})
OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" ON)
ELSE ()
MESSAGE("NVidia OPENCL NOT FOUND")
OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" OFF)
ENDIF ()
ENDIF(MSVC)

ELSE(BUILD_MULTITHREADING)
# SET(BUILD_NVIDIA_OPENCL_DEMOS OFF CACHE BOOL "Build OpenCL demos for NVidia" FORCE)
# SET(BUILD_AMD_OPENCL_DEMOS OFF CACHE BOOL "Build OpenCL demos for AMD" FORCE)
# SET(BUILD_INTEL_OPENCL_DEMOS OFF CACHE BOOL "Build OpenCL demos for Intel (CPU)" FORCE)
# SET(BUILD_MINICL_OPENCL_DEMOS OFF CACHE BOOL "Build OpenCL demos for MiniCL (Generic CPU)" FORCE)
# SET(USE_DX11 OFF CACHE BOOL "Use DirectX 11" FORCE)
# SET(USE_MULTITHREADED_BENCHMARK OFF CACHE BOOL "Use Multithreaded Benchmark" FORCE)
ENDIF(BUILD_MULTITHREADING)




#SET(CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:NO")
Expand Down Expand Up @@ -91,9 +214,13 @@ IF(MSVC)
ENDFOREACH(flag_var)
ENDIF (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)

OPTION(USE_MSVC_SSE "Use MSVC /arch:sse option" ON)
IF (USE_MSVC_SSE)
IF (CMAKE_CL_64)
ADD_DEFINITIONS(-D_WIN64)
ELSE()
OPTION(USE_MSVC_SSE "Use MSVC /arch:sse option" ON)
IF (USE_MSVC_SSE)
ADD_DEFINITIONS(/arch:SSE)
ENDIF()
ENDIF()
OPTION(USE_MSVC_FAST_FLOATINGPOINT "Use MSVC /fp:fast option" ON)
IF (USE_MSVC_FAST_FLOATINGPOINT)
Expand All @@ -117,41 +244,16 @@ ELSE()
SET (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE PATH "Single output directory for building all libraries.")
ENDIF()



OPTION(INTERNAL_CREATE_MSVC_RELATIVE_PATH_PROJECTFILES "Create MSVC projectfiles with relative paths" OFF)
OPTION(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES "Add MSVC postfix for executable names (_Debug)" OFF)

IF(MSVC)
FIND_PATH(AMD_OPENCL_BASE_DIR include/CL/cl.h PATH $ENV{ATISTREAMSDKROOT} )
IF(AMD_OPENCL_BASE_DIR)
#AMD adds an extras slash at the end of the ATISTREAMSDKROOT variable
SET(AMD_OPENCL_INCLUDES ${AMD_OPENCL_BASE_DIR}/include )
MESSAGE(${AMD_OPENCL_INCLUDES})
IF (CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBPATH ${AMD_OPENCL_BASE_DIR}/lib/x86_64 )
ELSE(CMAKE_CL_64)
SET(CMAKE_ATISTREAMSDK_LIBPATH ${AMD_OPENCL_BASE_DIR}/lib/x86 )
ENDIF(CMAKE_CL_64)
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" ON)
ELSE()
OPTION(BUILD_AMD_OPENCL_DEMOS "Build OpenCL demos for AMD (GPU or CPU)" OFF)
ENDIF()

FIND_PATH(NVIDIA_OPENCL_BASE_DIR OpenCL/common/inc/CL/cl.h PATH $ENV{NVSDKCOMPUTE_ROOT} )
IF(NVIDIA_OPENCL_BASE_DIR)
SET(NVIDIA_OPENCL_INCLUDES ${NVIDIA_OPENCL_BASE_DIR}/OpenCL/common/inc )
MESSAGE(${NVIDIA_OPENCL_INCLUDES})
IF (CMAKE_CL_64)
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/OpenCL/common/lib/x64 )
ELSE(CMAKE_CL_64)
SET(CMAKE_NVSDKCOMPUTE_LIBPATH ${NVIDIA_OPENCL_BASE_DIR}/OpenCL/common/lib/Win32 )
ENDIF(CMAKE_CL_64)
SET(NVIDIA_OPENCL_LIBRARIES ${CMAKE_NVSDKCOMPUTE_LIBPATH}/OpenCL.lib)

OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" ON)
ELSE()
OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" OFF)
ENDIF()
ENDIF()
SET(CMAKE_DEBUG_POSTFIX "_Debug" CACHE STRING "Adds a postfix for debug-built libraries.")
SET(CMAKE_MINSIZEREL_POSTFIX "_MinsizeRel" CACHE STRING "Adds a postfix for MinsizeRelease-built libraries.")
SET(CMAKE_RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo" CACHE STRING "Adds a postfix for ReleaseWithDebug-built libraries.")





Expand All @@ -162,22 +264,6 @@ ENDIF(INTERNAL_CREATE_MSVC_RELATIVE_PATH_PROJECTFILES)

ENDIF (WIN32)

IF (MSVC OR APPLE)
OPTION(BUILD_MINICL_OPENCL_DEMOS "Build OpenCL demos for MiniCL (Generic CPU)" ON)
ELSE()
OPTION(BUILD_MINICL_OPENCL_DEMOS "Build OpenCL demos for MiniCL (Generic CPU)" OFF)

FIND_PATH(NVIDIA_OPENCL_INCLUDES CL/cl.h)
FIND_LIBRARY(NVIDIA_OPENCL_LIBRARIES OpenCL PATH /usr/lib /usr/local/lib)
IF (NVIDIA_OPENCL_INCLUDES AND NVIDIA_OPENCL_LIBRARIES)
MESSAGE("OPENCL FOUND")
MESSAGE(${NVIDIA_OPENCL_LIBRARIES})
OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" ON)
ELSE ()
MESSAGE("OPENCL NOT FOUND")
OPTION(BUILD_NVIDIA_OPENCL_DEMOS "Build OpenCL demos for NVidia (GPU)" OFF)
ENDIF ()
ENDIF()

OPTION(BUILD_CPU_DEMOS "Build original Bullet CPU demos" ON)

Expand Down Expand Up @@ -336,3 +422,18 @@ OPTION(BUILD_UNIT_TESTS "Build Unit Tests" OFF)
IF (BUILD_UNIT_TESTS)
SUBDIRS(UnitTests)
ENDIF()

set (BULLET_CONFIG_CMAKE_PATH lib${LIB_SUFFIX}/cmake/bullet )
list (APPEND BULLET_LIBRARIES LinearMath)
list (APPEND BULLET_LIBRARIES BulletCollisions)
list (APPEND BULLET_LIBRARIES BulletDynamics)
list (APPEND BULLET_LIBRARIES BulletSoftBody)
set (BULLET_USE_FILE ${CMAKE_INSTALL_PREFIX}/${BULLET_CONFIG_CMAKE_PATH}/UseBullet.cmake)
configure_file ( ${CMAKE_SOURCE_DIR}/BulletConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake
@ONLY ESCAPE_QUOTES
)
install ( FILES ${CMAKE_SOURCE_DIR}/UseBullet.cmake
${CMAKE_CURRENT_BINARY_DIR}/BulletConfig.cmake
DESTINATION ${BULLET_CONFIG_CMAKE_PATH}
)
Loading

0 comments on commit 2018d36

Please sign in to comment.