mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 16:20:21 +00:00
commit
2ee414abe4
@ -376,12 +376,7 @@ printf "Bullet 2.83.5... "
|
|||||||
mv Bullet-2.83.5-win$BITS Bullet
|
mv Bullet-2.83.5-win$BITS Bullet
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BULLET_SDK="`real_pwd`/Bullet"
|
export BULLET_ROOT="`real_pwd`/Bullet"
|
||||||
add_cmake_opts -DBULLET_INCLUDE_DIR="$BULLET_SDK/include/bullet" \
|
|
||||||
-DBULLET_COLLISION_LIBRARY="$BULLET_SDK/lib/BulletCollision.lib" \
|
|
||||||
-DBULLET_COLLISION_LIBRARY_DEBUG="$BULLET_SDK/lib/BulletCollision_Debug.lib" \
|
|
||||||
-DBULLET_MATH_LIBRARY="$BULLET_SDK/lib/LinearMath.lib" \
|
|
||||||
-DBULLET_MATH_LIBRARY_DEBUG="$BULLET_SDK/lib/LinearMath_Debug.lib"
|
|
||||||
|
|
||||||
echo Done.
|
echo Done.
|
||||||
}
|
}
|
||||||
|
@ -281,10 +281,7 @@ endif()
|
|||||||
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
|
||||||
find_package(SDL2 REQUIRED)
|
find_package(SDL2 REQUIRED)
|
||||||
find_package(OpenAL REQUIRED)
|
find_package(OpenAL REQUIRED)
|
||||||
find_package(Bullet REQUIRED)
|
find_package(Bullet 283 REQUIRED COMPONENTS BulletCollision LinearMath)
|
||||||
if (NOT BULLET_FOUND OR BULLET_VERSION VERSION_LESS 283)
|
|
||||||
message(FATAL_ERROR "OpenMW requires Bullet version 2.83 or later")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories("."
|
include_directories("."
|
||||||
SYSTEM
|
SYSTEM
|
||||||
@ -292,7 +289,7 @@ include_directories("."
|
|||||||
${Boost_INCLUDE_DIR}
|
${Boost_INCLUDE_DIR}
|
||||||
${MYGUI_INCLUDE_DIRS}
|
${MYGUI_INCLUDE_DIRS}
|
||||||
${OPENAL_INCLUDE_DIR}
|
${OPENAL_INCLUDE_DIR}
|
||||||
${BULLET_INCLUDE_DIRS}
|
${Bullet_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
link_directories(${SDL2_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${MYGUI_LIB_DIR})
|
link_directories(${SDL2_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS} ${MYGUI_LIB_DIR})
|
||||||
|
@ -132,7 +132,6 @@ target_link_libraries(openmw
|
|||||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||||
${OPENAL_LIBRARY}
|
${OPENAL_LIBRARY}
|
||||||
${FFmpeg_LIBRARIES}
|
${FFmpeg_LIBRARIES}
|
||||||
${BULLET_LIBRARIES}
|
|
||||||
${MYGUI_LIBRARIES}
|
${MYGUI_LIBRARIES}
|
||||||
${SDL2_LIBRARY}
|
${SDL2_LIBRARY}
|
||||||
"osg-ffmpeg-videoplayer"
|
"osg-ffmpeg-videoplayer"
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
# - Try to find the Bullet physics engine
|
# - Try to find the Bullet physics engine
|
||||||
#
|
#
|
||||||
# This module defines the following variables
|
# This module accepts the following env 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
|
# BULLET_ROOT - Can be set to bullet install path or Windows build path
|
||||||
#
|
#
|
||||||
|
# Once done this will define
|
||||||
|
# Bullet_FOUND - System has the all required components.
|
||||||
|
# Bullet_INCLUDE_DIRS - Include directory necessary for using the required components headers.
|
||||||
|
# Bullet_LIBRARIES - Link these to use the required bullet components.
|
||||||
|
# Bullet_VERSION - Version of libbullet
|
||||||
|
#
|
||||||
|
# For each of the components
|
||||||
|
# - LinearMath
|
||||||
|
# - BulletCollision
|
||||||
|
# - BulletSoftBody
|
||||||
|
# - BulletDynamics
|
||||||
|
#
|
||||||
# Copyright (c) 2009, Philip Lowman <philip at yhbt.com>
|
# Copyright (c) 2009, Philip Lowman <philip at yhbt.com>
|
||||||
# Modified for OpenMW to parse BT_BULLET_VERSION.
|
# Modified for OpenMW to parse BT_BULLET_VERSION.
|
||||||
#
|
#
|
||||||
@ -20,67 +22,52 @@
|
|||||||
# BSD license.
|
# BSD license.
|
||||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
|
||||||
include(PreprocessorUtils)
|
include(LibFindMacros)
|
||||||
|
|
||||||
set(BULLET_ROOT $ENV{BULLET_ROOT})
|
# Macro: _internal_find_bullet_library
|
||||||
|
# Checks for the given component by invoking pkgconfig etc.
|
||||||
macro(_FIND_BULLET_LIBRARY _var)
|
macro(_internal_find_bullet_library _lib)
|
||||||
find_library(${_var}
|
libfind_pkg_detect(Bullet_${_lib} bullet
|
||||||
NAMES
|
FIND_LIBRARY ${_lib}
|
||||||
${ARGN}
|
HINTS $ENV{BULLET_ROOT}
|
||||||
PATHS
|
PATH_SUFFIXES lib
|
||||||
${BULLET_ROOT}
|
)
|
||||||
${BULLET_ROOT}/lib/Debug
|
libfind_process(Bullet_${_lib})
|
||||||
${BULLET_ROOT}/lib/Release
|
|
||||||
${BULLET_ROOT}/out/release8/libs
|
|
||||||
${BULLET_ROOT}/out/debug8/libs
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
)
|
|
||||||
mark_as_advanced(${_var})
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(_BULLET_APPEND_LIBRARIES _list _release)
|
set(_known_components LinearMath BulletCollision BulletSoftBody BulletDynamics)
|
||||||
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
|
# Check if the required components were found and add their stuff to the Bullet_* vars.
|
||||||
PATHS
|
foreach (_component ${Bullet_FIND_COMPONENTS})
|
||||||
${BULLET_ROOT}/include
|
list(FIND _known_components ${_component} _known_component)
|
||||||
${BULLET_ROOT}/src
|
if (_known_component EQUAL -1)
|
||||||
PATH_SUFFIXES bullet
|
message(FATAL_ERROR "Unknown component '${_component}'")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(Bullet_${_component}_Debug_FIND_QUIETLY TRUE) # don't spam messages with optional Debug component
|
||||||
|
_internal_find_bullet_library(${_component})
|
||||||
|
_internal_find_bullet_library(${_component}_Debug)
|
||||||
|
|
||||||
|
if (Bullet_${_component}_Debug_FOUND)
|
||||||
|
set(Bullet_LIBRARIES ${Bullet_LIBRARIES} optimized ${Bullet_${_component}_LIBRARIES} debug ${Bullet_${_component}_Debug_LIBRARIES})
|
||||||
|
else()
|
||||||
|
set(Bullet_LIBRARIES ${Bullet_LIBRARIES} ${Bullet_${_component}_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
libfind_pkg_detect(Bullet bullet
|
||||||
|
FIND_PATH btBulletCollisionCommon.h
|
||||||
|
HINTS $ENV{BULLET_ROOT}
|
||||||
|
PATH_SUFFIXES include/bullet
|
||||||
)
|
)
|
||||||
|
set(Bullet_INCLUDE_DIRS ${Bullet_INCLUDE_DIR})
|
||||||
|
libfind_version_header(Bullet LinearMath/btScalar.h BT_BULLET_VERSION)
|
||||||
|
|
||||||
# Find the libraries
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet
|
||||||
|
FOUND_VAR Bullet_FOUND
|
||||||
#_FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY BulletDynamics)
|
VERSION_VAR Bullet_VERSION
|
||||||
#_FIND_BULLET_LIBRARY(BULLET_DYNAMICS_LIBRARY_DEBUG BulletDynamics_Debug BulletDynamics_d)
|
HANDLE_COMPONENTS
|
||||||
_FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY BulletCollision)
|
REQUIRED_VARS
|
||||||
_FIND_BULLET_LIBRARY(BULLET_COLLISION_LIBRARY_DEBUG BulletCollision_Debug BulletCollision_d)
|
Bullet_LIBRARIES
|
||||||
_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY BulletMath LinearMath)
|
Bullet_INCLUDE_DIR
|
||||||
_FIND_BULLET_LIBRARY(BULLET_MATH_LIBRARY_DEBUG BulletMath_Debug BulletMath_d LinearMath_debug LinearMath_d)
|
)
|
||||||
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set BULLET_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Bullet DEFAULT_MSG
|
|
||||||
#BULLET_DYNAMICS_LIBRARY
|
|
||||||
BULLET_COLLISION_LIBRARY BULLET_MATH_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)
|
|
||||||
|
|
||||||
find_file(BULLET_BTSCALAR_FILE NAMES btScalar.h PATHS "${BULLET_INCLUDE_DIR}/LinearMath")
|
|
||||||
file(READ ${BULLET_BTSCALAR_FILE} BULLET_BTSCALAR_CONTENT)
|
|
||||||
get_preprocessor_entry(BULLET_BTSCALAR_CONTENT BT_BULLET_VERSION BULLET_VERSION)
|
|
||||||
message(STATUS "Bullet version: ${BULLET_VERSION}")
|
|
||||||
endif()
|
|
||||||
|
@ -200,6 +200,11 @@ function (libfind_process PREFIX)
|
|||||||
foreach (i ${configopts})
|
foreach (i ${configopts})
|
||||||
mark_as_advanced(${i})
|
mark_as_advanced(${i})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
set (${PREFIX}_INCLUDE_OPTS ${includeopts} PARENT_SCOPE)
|
||||||
|
set (${PREFIX}_LIBRARY_OPTS ${libraryopts} PARENT_SCOPE)
|
||||||
|
set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
|
||||||
|
set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
|
||||||
|
set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
|
||||||
if (NOT quiet)
|
if (NOT quiet)
|
||||||
message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
message(STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
||||||
if (LIBFIND_DEBUG)
|
if (LIBFIND_DEBUG)
|
||||||
@ -209,11 +214,6 @@ function (libfind_process PREFIX)
|
|||||||
message(STATUS " ${PREFIX}_LIBRARY_OPTS=${libraryopts}")
|
message(STATUS " ${PREFIX}_LIBRARY_OPTS=${libraryopts}")
|
||||||
message(STATUS " ${PREFIX}_LIBRARIES=${libs}")
|
message(STATUS " ${PREFIX}_LIBRARIES=${libs}")
|
||||||
endif()
|
endif()
|
||||||
set (${PREFIX}_INCLUDE_OPTS ${includeopts} PARENT_SCOPE)
|
|
||||||
set (${PREFIX}_LIBRARY_OPTS ${libraryopts} PARENT_SCOPE)
|
|
||||||
set (${PREFIX}_INCLUDE_DIRS ${includes} PARENT_SCOPE)
|
|
||||||
set (${PREFIX}_LIBRARIES ${libs} PARENT_SCOPE)
|
|
||||||
set (${PREFIX}_FOUND TRUE PARENT_SCOPE)
|
|
||||||
endif()
|
endif()
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
@ -181,7 +181,7 @@ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
include_directories(${BULLET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
|
include_directories(${Bullet_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|
||||||
add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
|
add_library(components STATIC ${COMPONENT_FILES} ${MOC_SRCS} ${ESM_UI_HDR})
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ target_link_libraries(components
|
|||||||
${OSGGA_LIBRARIES}
|
${OSGGA_LIBRARIES}
|
||||||
${OSGFX_LIBRARIES}
|
${OSGFX_LIBRARIES}
|
||||||
${OSGANIMATION_LIBRARIES}
|
${OSGANIMATION_LIBRARIES}
|
||||||
${BULLET_LIBRARIES}
|
${Bullet_LIBRARIES}
|
||||||
${SDL2_LIBRARY}
|
${SDL2_LIBRARY}
|
||||||
# For MyGUI platform
|
# For MyGUI platform
|
||||||
${GL_LIB}
|
${GL_LIB}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user