[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53515] trunk/blender: add option WITH_SYSTEM_BULLET to link against the bullet installation found on the system .
Campbell Barton
ideasman42 at gmail.com
Thu Jan 3 01:23:53 CET 2013
Revision: 53515
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53515
Author: campbellbarton
Date: 2013-01-03 00:23:52 +0000 (Thu, 03 Jan 2013)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/CMakeLists.txt
trunk/blender/build_files/cmake/macros.cmake
trunk/blender/extern/CMakeLists.txt
trunk/blender/intern/smoke/CMakeLists.txt
trunk/blender/source/blender/blenkernel/CMakeLists.txt
trunk/blender/source/blender/bmesh/CMakeLists.txt
trunk/blender/source/creator/CMakeLists.txt
trunk/blender/source/gameengine/BlenderRoutines/CMakeLists.txt
trunk/blender/source/gameengine/Converter/CMakeLists.txt
trunk/blender/source/gameengine/Ketsji/CMakeLists.txt
trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt
Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -129,6 +129,8 @@
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_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_PLAYER "Build Player" OFF)
option(WITH_OPENCOLORIO "Enable OpenColorIO color management" ON)
@@ -1842,12 +1844,26 @@
set(GLEW_INCLUDE_PATH "${CMAKE_SOURCE_DIR}/extern/glew/include")
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.
if(WITH_PYTHON_MODULE)
add_definitions(-DPy_ENABLE_SHARED)
-endif()
+endif().
#-----------------------------------------------------------------------------
# Extra compile flags
Modified: trunk/blender/build_files/cmake/macros.cmake
===================================================================
--- trunk/blender/build_files/cmake/macros.cmake 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/build_files/cmake/macros.cmake 2013-01-03 00:23:52 UTC (rev 53515)
@@ -282,7 +282,9 @@
if(WITH_SYSTEM_GLEW)
target_link_libraries(${target} ${GLEW_LIBRARY})
endif()
-
+ if(WITH_BULLET AND WITH_SYSTEM_BULLET)
+ target_link_libraries(${target} ${BULLET_LIBRARIES})
+ endif()
if(WITH_OPENAL)
target_link_libraries(${target} ${OPENAL_LIBRARY})
endif()
Modified: trunk/blender/extern/CMakeLists.txt
===================================================================
--- trunk/blender/extern/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/extern/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -30,7 +30,9 @@
add_subdirectory(rangetree)
if(WITH_BULLET)
- add_subdirectory(bullet2)
+ if(NOT WITH_SYSTEM_BULLET)
+ add_subdirectory(bullet2)
+ endif()
endif()
# now only available in a branch
Modified: trunk/blender/intern/smoke/CMakeLists.txt
===================================================================
--- trunk/blender/intern/smoke/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/intern/smoke/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -29,7 +29,7 @@
)
set(INC_SYS
- ../../extern/bullet2/src
+ ${BULLET_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
${ZLIB_INCLUDE_DIRS}
)
Modified: trunk/blender/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/blenkernel/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/blender/blenkernel/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -259,7 +259,7 @@
if(WITH_BULLET)
list(APPEND INC_SYS
- ../../../extern/bullet2/src
+ ${BULLET_INCLUDE_DIRS}
)
add_definitions(-DUSE_BULLET)
endif()
Modified: trunk/blender/source/blender/bmesh/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/bmesh/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/blender/bmesh/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -30,7 +30,6 @@
../blenlib
../makesdna
../../../intern/guardedalloc
- ../../../extern/bullet2/src
../../../extern/rangetree
../../../intern/opennl/extern
)
@@ -127,6 +126,9 @@
if(WITH_BULLET)
add_definitions(-DWITH_BULLET)
+ list(APPEND INC_SYS
+ ${BULLET_INCLUDE_DIRS}
+ )
endif()
if(WITH_INTERNATIONAL)
Modified: trunk/blender/source/creator/CMakeLists.txt
===================================================================
--- trunk/blender/source/creator/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/creator/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -893,7 +893,6 @@
ge_scenegraph
ge_logic_network
ge_logic_ngnetwork
- extern_bullet
ge_logic_loopbacknetwork
bf_intern_moto
extern_openjpeg
@@ -972,6 +971,10 @@
list(APPEND BLENDER_SORTED_LIBS bf_intern_locale)
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})
set(REMLIB ${SORTLIB})
foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
Modified: trunk/blender/source/gameengine/BlenderRoutines/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/BlenderRoutines/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/gameengine/BlenderRoutines/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -30,7 +30,6 @@
)
set(INC_SYS
- ../../../extern/bullet2/src
${PTHREADS_INCLUDE_DIRS}
${GLEW_INCLUDE_PATH}
${BOOST_INCLUDE_DIR}
@@ -70,4 +69,12 @@
add_definitions(-DWITH_FFMPEG)
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}")
Modified: trunk/blender/source/gameengine/Converter/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/Converter/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/gameengine/Converter/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -112,7 +112,7 @@
if(WITH_BULLET)
list(APPEND INC_SYS
- ../../../extern/bullet2/src
+ ${BULLET_INCLUDE_DIRS}
)
add_definitions(-DUSE_BULLET)
endif()
Modified: trunk/blender/source/gameengine/Ketsji/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/Ketsji/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/gameengine/Ketsji/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -252,7 +252,7 @@
../Physics/Bullet
)
list(APPEND INC
- ../../../extern/bullet2/src
+ ${BULLET_INCLUDE_DIRS}
)
add_definitions(-DUSE_BULLET)
endif()
Modified: trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt 2013-01-03 00:20:15 UTC (rev 53514)
+++ trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt 2013-01-03 00:23:52 UTC (rev 53515)
@@ -44,7 +44,6 @@
)
set(INC_SYS
- ../../../../extern/bullet2/src
${GLEW_INCLUDE_PATH}
${PYTHON_INCLUDE_DIRS}
)
@@ -60,6 +59,9 @@
)
if(WITH_BULLET)
+ list(APPEND INC
+ ${BULLET_INCLUDE_DIRS}
+ )
add_definitions(-DUSE_BULLET)
endif()
More information about the Bf-blender-cvs
mailing list