Parse the bullet version in FindBullet.cmake

move
scrawl 9 years ago
parent 83a9a164bc
commit 9eb96b9cb6

@ -304,6 +304,9 @@ find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(SDL2 REQUIRED)
find_package(OpenAL REQUIRED)
find_package(Bullet REQUIRED)
if (NOT BULLET_FOUND OR BULLET_VERSION VERSION_LESS 283)
message(FATAL_ERROR "OpenMW requires Bullet version 2.83 or later")
endif()
include_directories("."
SYSTEM

@ -14,11 +14,14 @@
#
# Copyright (c) 2009, Philip Lowman <philip at yhbt.com>
# Modified for OpenMW to parse BT_BULLET_VERSION.
#
# Redistribution AND use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(PreprocessorUtils)
set(BULLET_ROOT $ENV{BULLET_ROOT})
macro(_FIND_BULLET_LIBRARY _var)
@ -75,4 +78,9 @@ 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()

@ -6,15 +6,9 @@
#include <osg/ref_ptr>
#include <LinearMath/btScalar.h>
#include "bulletshape.hpp"
#include "resourcemanager.hpp"
#if BT_BULLET_VERSION < 283
#error "OpenMW requires Bullet version 2.83 or later"
#endif
namespace Resource
{
class SceneManager;

Loading…
Cancel
Save