Skip to content

Commit

Permalink
Update CMakeList to include bullet library
Browse files Browse the repository at this point in the history
Only by adding the bullet library I was able to complete compilation on Linux (Linux Mint 17.2). This solves issue 1801:
cocos2d#1801
  • Loading branch information
fgolemo committed Oct 3, 2015
1 parent 1ab245d commit 21bb417
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/framewor
include(CocosBuildHelpers)

option(USE_CHIPMUNK "Use chipmunk for physics library" ON)
option(USE_BULLET "Use bullet for physics3d library" ON)
option(USE_BOX2D "Use box2d for physics library" OFF)
option(DEBUG_MODE "Debug or release?" ON)
option(BUILD_EXTENSIONS "Build extension library" ON)
Expand Down Expand Up @@ -193,6 +194,24 @@ else()
add_definitions(-DCC_ENABLE_BOX2D_INTEGRATION=0)
endif(USE_BOX2D)

# Bullet (not prebuilded, exists as source)
if(USE_BULLET)
if(USE_PREBUILT_LIBS)
add_subdirectory(frameworks/cocos2d-x/external/bullet)
set(BULLET_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/frameworks/cocos2d-x/external/bullet)
set(BULLET_LIBRARIES bullet)
else()
cocos_find_package(bullet BULLET REQUIRED)
set(BULLET_LIBRARIES bullet)
endif()
message(STATUS "Bullet include dirs: ${BULLET_INCLUDE_DIRS}")
add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=1)
add_definitions(-DCC_USE_PHYSICS=1)
else()
add_definitions(-DCC_ENABLE_BULLET_INTEGRATION=0)
add_definitions(-DCC_USE_3D_PHYSICS=0)
endif(USE_BULLET)

# Tinyxml2 (not prebuilded, exists as source)
if(USE_PREBUILT_LIBS)
add_subdirectory(frameworks/js-bindings/cocos2d-x/external/tinyxml2)
Expand Down

0 comments on commit 21bb417

Please sign in to comment.