add option WITH_SYSTEM_BULLET to link against the bullet installation found on the system.
Note: this doesn't work yet for everything with latest stable bullet (2.81), need to look into why and likely apply some patches upstream. However I managed to link blender by disabling some features, likely it can be made to work without too much trouble.
This commit is contained in:
@@ -129,6 +129,8 @@ option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development
|
|||||||
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
|
||||||
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ON)
|
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ON)
|
||||||
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
|
||||||
|
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
|
||||||
|
mark_as_advanced(WITH_SYSTEM_BULLET)
|
||||||
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
option(WITH_GAMEENGINE "Enable Game Engine" ON)
|
||||||
option(WITH_PLAYER "Build Player" OFF)
|
option(WITH_PLAYER "Build Player" OFF)
|
||||||
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
|
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
|
||||||
@@ -1842,12 +1844,26 @@ else()
|
|||||||
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
|
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# Configure Bullet
|
||||||
|
|
||||||
|
if(WITH_BULLET AND WITH_SYSTEM_BULLET)
|
||||||
|
find_package(Bullet)
|
||||||
|
if(NOT BULLET_FOUND)
|
||||||
|
set(WITH_BULLET OFF)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set(BULLET_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/bullet2/src")
|
||||||
|
# set(BULLET_LIBRARIES "")
|
||||||
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Configure Python.
|
# Configure Python.
|
||||||
|
|
||||||
if(WITH_PYTHON_MODULE)
|
if(WITH_PYTHON_MODULE)
|
||||||
add_definitions(-DPy_ENABLE_SHARED)
|
add_definitions(-DPy_ENABLE_SHARED)
|
||||||
endif()
|
endif().
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Extra compile flags
|
# Extra compile flags
|
||||||
|
@@ -282,7 +282,9 @@ macro(setup_liblinks
|
|||||||
if(WITH_SYSTEM_GLEW)
|
if(WITH_SYSTEM_GLEW)
|
||||||
target_link_libraries(${target} ${GLEW_LIBRARY})
|
target_link_libraries(${target} ${GLEW_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
if(WITH_BULLET AND WITH_SYSTEM_BULLET)
|
||||||
|
target_link_libraries(${target} ${BULLET_LIBRARIES})
|
||||||
|
endif()
|
||||||
if(WITH_OPENAL)
|
if(WITH_OPENAL)
|
||||||
target_link_libraries(${target} ${OPENAL_LIBRARY})
|
target_link_libraries(${target} ${OPENAL_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
4
extern/CMakeLists.txt
vendored
4
extern/CMakeLists.txt
vendored
@@ -30,7 +30,9 @@ add_subdirectory(colamd)
|
|||||||
add_subdirectory(rangetree)
|
add_subdirectory(rangetree)
|
||||||
|
|
||||||
if(WITH_BULLET)
|
if(WITH_BULLET)
|
||||||
add_subdirectory(bullet2)
|
if(NOT WITH_SYSTEM_BULLET)
|
||||||
|
add_subdirectory(bullet2)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# now only available in a branch
|
# now only available in a branch
|
||||||
|
@@ -29,7 +29,7 @@ set(INC
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(INC_SYS
|
set(INC_SYS
|
||||||
../../extern/bullet2/src
|
${BULLET_INCLUDE_DIRS}
|
||||||
${PNG_INCLUDE_DIR}
|
${PNG_INCLUDE_DIR}
|
||||||
${ZLIB_INCLUDE_DIRS}
|
${ZLIB_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
@@ -259,7 +259,7 @@ endif()
|
|||||||
|
|
||||||
if(WITH_BULLET)
|
if(WITH_BULLET)
|
||||||
list(APPEND INC_SYS
|
list(APPEND INC_SYS
|
||||||
../../../extern/bullet2/src
|
${BULLET_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
add_definitions(-DUSE_BULLET)
|
add_definitions(-DUSE_BULLET)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -30,7 +30,6 @@ set(INC
|
|||||||
../blenlib
|
../blenlib
|
||||||
../makesdna
|
../makesdna
|
||||||
../../../intern/guardedalloc
|
../../../intern/guardedalloc
|
||||||
../../../extern/bullet2/src
|
|
||||||
../../../extern/rangetree
|
../../../extern/rangetree
|
||||||
../../../intern/opennl/extern
|
../../../intern/opennl/extern
|
||||||
)
|
)
|
||||||
@@ -127,6 +126,9 @@ endif()
|
|||||||
|
|
||||||
if(WITH_BULLET)
|
if(WITH_BULLET)
|
||||||
add_definitions(-DWITH_BULLET)
|
add_definitions(-DWITH_BULLET)
|
||||||
|
list(APPEND INC_SYS
|
||||||
|
${BULLET_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(WITH_INTERNATIONAL)
|
if(WITH_INTERNATIONAL)
|
||||||
|
@@ -893,7 +893,6 @@ endif()
|
|||||||
ge_scenegraph
|
ge_scenegraph
|
||||||
ge_logic_network
|
ge_logic_network
|
||||||
ge_logic_ngnetwork
|
ge_logic_ngnetwork
|
||||||
extern_bullet
|
|
||||||
ge_logic_loopbacknetwork
|
ge_logic_loopbacknetwork
|
||||||
bf_intern_moto
|
bf_intern_moto
|
||||||
extern_openjpeg
|
extern_openjpeg
|
||||||
@@ -972,6 +971,10 @@ endif()
|
|||||||
list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
|
list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_BULLET AND NOT WITH_BULLET_SYSTEM)
|
||||||
|
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(SORTLIB ${BLENDER_SORTED_LIBS})
|
foreach(SORTLIB ${BLENDER_SORTED_LIBS})
|
||||||
set(REMLIB ${SORTLIB})
|
set(REMLIB ${SORTLIB})
|
||||||
foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
|
foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
|
||||||
|
@@ -30,7 +30,6 @@ set(INC
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(INC_SYS
|
set(INC_SYS
|
||||||
../../../extern/bullet2/src
|
|
||||||
${PTHREADS_INCLUDE_DIRS}
|
${PTHREADS_INCLUDE_DIRS}
|
||||||
${GLEW_INCLUDE_PATH}
|
${GLEW_INCLUDE_PATH}
|
||||||
${BOOST_INCLUDE_DIR}
|
${BOOST_INCLUDE_DIR}
|
||||||
@@ -70,4 +69,12 @@ if(WITH_CODEC_FFMPEG)
|
|||||||
add_definitions(-DWITH_FFMPEG)
|
add_definitions(-DWITH_FFMPEG)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_BULLET)
|
||||||
|
list(APPEND INC_SYS
|
||||||
|
${BULLET_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
add_definitions(-DUSE_BULLET)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
blender_add_lib(ge_blen_routines "${SRC}" "${INC}" "${INC_SYS}")
|
blender_add_lib(ge_blen_routines "${SRC}" "${INC}" "${INC_SYS}")
|
||||||
|
@@ -112,7 +112,7 @@ set(SRC
|
|||||||
|
|
||||||
if(WITH_BULLET)
|
if(WITH_BULLET)
|
||||||
list(APPEND INC_SYS
|
list(APPEND INC_SYS
|
||||||
../../../extern/bullet2/src
|
${BULLET_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
add_definitions(-DUSE_BULLET)
|
add_definitions(-DUSE_BULLET)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -252,7 +252,7 @@ if(WITH_BULLET)
|
|||||||
../Physics/Bullet
|
../Physics/Bullet
|
||||||
)
|
)
|
||||||
list(APPEND INC
|
list(APPEND INC
|
||||||
../../../extern/bullet2/src
|
${BULLET_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
add_definitions(-DUSE_BULLET)
|
add_definitions(-DUSE_BULLET)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -44,7 +44,6 @@ set(INC
|
|||||||
)
|
)
|
||||||
|
|
||||||
set(INC_SYS
|
set(INC_SYS
|
||||||
../../../../extern/bullet2/src
|
|
||||||
${GLEW_INCLUDE_PATH}
|
${GLEW_INCLUDE_PATH}
|
||||||
${PYTHON_INCLUDE_DIRS}
|
${PYTHON_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
@@ -60,6 +59,9 @@ set(SRC
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(WITH_BULLET)
|
if(WITH_BULLET)
|
||||||
|
list(APPEND INC
|
||||||
|
${BULLET_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
add_definitions(-DUSE_BULLET)
|
add_definitions(-DUSE_BULLET)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user