2011-01-14 16:05:45 +00:00
|
|
|
# Minimum cmake version required
|
2016-03-03 16:25:53 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
|
2011-01-14 16:05:45 +00:00
|
|
|
|
|
|
|
# Project configuration
|
2016-03-03 16:25:53 +00:00
|
|
|
PROJECT(REACTPHYSICS3D CXX)
|
2012-07-31 21:48:35 +00:00
|
|
|
|
2014-07-08 21:47:14 +00:00
|
|
|
# Build type
|
|
|
|
IF (NOT CMAKE_BUILD_TYPE)
|
|
|
|
SET(CMAKE_BUILD_TYPE "Release")
|
|
|
|
ENDIF (NOT CMAKE_BUILD_TYPE)
|
2013-10-06 14:03:25 +00:00
|
|
|
|
2012-07-31 21:48:35 +00:00
|
|
|
# Where to build the library
|
2013-10-06 14:03:25 +00:00
|
|
|
SET(LIBRARY_OUTPUT_PATH "lib")
|
|
|
|
|
|
|
|
# Where to build the executables
|
|
|
|
SET(OUR_EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}/bin")
|
2012-07-31 21:48:35 +00:00
|
|
|
|
2015-07-12 10:11:20 +00:00
|
|
|
ENABLE_TESTING()
|
|
|
|
|
2012-07-31 21:48:35 +00:00
|
|
|
# Options
|
2015-04-08 18:50:31 +00:00
|
|
|
OPTION(COMPILE_TESTBED "Select this if you want to build the testbed application" OFF)
|
2013-03-09 07:40:22 +00:00
|
|
|
OPTION(COMPILE_TESTS "Select this if you want to build the tests" OFF)
|
2013-03-24 18:45:48 +00:00
|
|
|
OPTION(PROFILING_ENABLED "Select this if you want to compile with enabled profiling" OFF)
|
2013-05-12 12:08:30 +00:00
|
|
|
OPTION(DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating
|
|
|
|
values" OFF)
|
2015-08-17 04:44:26 +00:00
|
|
|
|
2016-03-03 16:25:53 +00:00
|
|
|
# Warning Compiler flags
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
|
|
|
|
|
|
|
# C++11 flags
|
|
|
|
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
|
|
include(CheckCXXCompilerFlag)
|
|
|
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
|
|
|
IF(COMPILER_SUPPORTS_CXX11)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
ELSE()
|
|
|
|
message("The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
2015-08-17 04:44:26 +00:00
|
|
|
|
2011-01-14 16:05:45 +00:00
|
|
|
# Headers
|
2012-07-31 21:48:35 +00:00
|
|
|
INCLUDE_DIRECTORIES(src)
|
2011-01-14 16:05:45 +00:00
|
|
|
|
2013-09-16 18:35:23 +00:00
|
|
|
IF(PROFILING_ENABLED)
|
|
|
|
ADD_DEFINITIONS(-DIS_PROFILING_ACTIVE)
|
|
|
|
ENDIF(PROFILING_ENABLED)
|
|
|
|
|
|
|
|
IF(DOUBLE_PRECISION_ENABLED)
|
|
|
|
ADD_DEFINITIONS(-DIS_DOUBLE_PRECISION_ENABLED)
|
|
|
|
ENDIF(DOUBLE_PRECISION_ENABLED)
|
2011-01-14 16:05:45 +00:00
|
|
|
|
2013-09-16 18:35:23 +00:00
|
|
|
# Source files
|
|
|
|
SET (REACTPHYSICS3D_SOURCES
|
|
|
|
"src/configuration.h"
|
|
|
|
"src/decimal.h"
|
|
|
|
"src/reactphysics3d.h"
|
|
|
|
"src/body/Body.h"
|
|
|
|
"src/body/Body.cpp"
|
|
|
|
"src/body/CollisionBody.h"
|
|
|
|
"src/body/CollisionBody.cpp"
|
|
|
|
"src/body/RigidBody.h"
|
|
|
|
"src/body/RigidBody.cpp"
|
|
|
|
"src/collision/broadphase/BroadPhaseAlgorithm.h"
|
|
|
|
"src/collision/broadphase/BroadPhaseAlgorithm.cpp"
|
2014-03-16 19:59:10 +00:00
|
|
|
"src/collision/broadphase/DynamicAABBTree.h"
|
|
|
|
"src/collision/broadphase/DynamicAABBTree.cpp"
|
2015-08-19 16:48:08 +00:00
|
|
|
"src/collision/narrowphase/CollisionDispatch.h"
|
|
|
|
"src/collision/narrowphase/DefaultCollisionDispatch.h"
|
|
|
|
"src/collision/narrowphase/DefaultCollisionDispatch.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/collision/narrowphase/EPA/EdgeEPA.h"
|
|
|
|
"src/collision/narrowphase/EPA/EdgeEPA.cpp"
|
|
|
|
"src/collision/narrowphase/EPA/EPAAlgorithm.h"
|
|
|
|
"src/collision/narrowphase/EPA/EPAAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/EPA/TriangleEPA.h"
|
|
|
|
"src/collision/narrowphase/EPA/TriangleEPA.cpp"
|
|
|
|
"src/collision/narrowphase/EPA/TrianglesStore.h"
|
|
|
|
"src/collision/narrowphase/EPA/TrianglesStore.cpp"
|
|
|
|
"src/collision/narrowphase/GJK/Simplex.h"
|
|
|
|
"src/collision/narrowphase/GJK/Simplex.cpp"
|
|
|
|
"src/collision/narrowphase/GJK/GJKAlgorithm.h"
|
|
|
|
"src/collision/narrowphase/GJK/GJKAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/NarrowPhaseAlgorithm.h"
|
|
|
|
"src/collision/narrowphase/NarrowPhaseAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/SphereVsSphereAlgorithm.h"
|
|
|
|
"src/collision/narrowphase/SphereVsSphereAlgorithm.cpp"
|
2015-08-27 20:31:05 +00:00
|
|
|
"src/collision/narrowphase/ConcaveVsConvexAlgorithm.h"
|
|
|
|
"src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/collision/shapes/AABB.h"
|
|
|
|
"src/collision/shapes/AABB.cpp"
|
2015-08-31 15:33:34 +00:00
|
|
|
"src/collision/shapes/ConvexShape.h"
|
|
|
|
"src/collision/shapes/ConvexShape.cpp"
|
|
|
|
"src/collision/shapes/ConcaveShape.h"
|
|
|
|
"src/collision/shapes/ConcaveShape.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/collision/shapes/BoxShape.h"
|
|
|
|
"src/collision/shapes/BoxShape.cpp"
|
|
|
|
"src/collision/shapes/CapsuleShape.h"
|
|
|
|
"src/collision/shapes/CapsuleShape.cpp"
|
|
|
|
"src/collision/shapes/CollisionShape.h"
|
|
|
|
"src/collision/shapes/CollisionShape.cpp"
|
|
|
|
"src/collision/shapes/ConeShape.h"
|
|
|
|
"src/collision/shapes/ConeShape.cpp"
|
|
|
|
"src/collision/shapes/ConvexMeshShape.h"
|
|
|
|
"src/collision/shapes/ConvexMeshShape.cpp"
|
|
|
|
"src/collision/shapes/CylinderShape.h"
|
|
|
|
"src/collision/shapes/CylinderShape.cpp"
|
|
|
|
"src/collision/shapes/SphereShape.h"
|
|
|
|
"src/collision/shapes/SphereShape.cpp"
|
2015-08-27 20:31:05 +00:00
|
|
|
"src/collision/shapes/TriangleShape.h"
|
|
|
|
"src/collision/shapes/TriangleShape.cpp"
|
|
|
|
"src/collision/shapes/ConcaveMeshShape.h"
|
|
|
|
"src/collision/shapes/ConcaveMeshShape.cpp"
|
2016-01-14 20:34:30 +00:00
|
|
|
"src/collision/shapes/HeightFieldShape.h"
|
|
|
|
"src/collision/shapes/HeightFieldShape.cpp"
|
2014-07-21 21:08:18 +00:00
|
|
|
"src/collision/RaycastInfo.h"
|
2014-11-04 21:38:40 +00:00
|
|
|
"src/collision/RaycastInfo.cpp"
|
2014-08-04 20:46:58 +00:00
|
|
|
"src/collision/ProxyShape.h"
|
|
|
|
"src/collision/ProxyShape.cpp"
|
2015-08-27 20:31:05 +00:00
|
|
|
"src/collision/TriangleVertexArray.h"
|
|
|
|
"src/collision/TriangleVertexArray.cpp"
|
|
|
|
"src/collision/TriangleMesh.h"
|
|
|
|
"src/collision/TriangleMesh.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/collision/CollisionDetection.h"
|
|
|
|
"src/collision/CollisionDetection.cpp"
|
2015-09-10 05:30:50 +00:00
|
|
|
"src/collision/CollisionShapeInfo.h"
|
2015-10-02 05:04:05 +00:00
|
|
|
"src/collision/ContactManifold.h"
|
|
|
|
"src/collision/ContactManifold.cpp"
|
|
|
|
"src/collision/ContactManifoldSet.h"
|
|
|
|
"src/collision/ContactManifoldSet.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/constraint/BallAndSocketJoint.h"
|
|
|
|
"src/constraint/BallAndSocketJoint.cpp"
|
|
|
|
"src/constraint/ContactPoint.h"
|
|
|
|
"src/constraint/ContactPoint.cpp"
|
|
|
|
"src/constraint/FixedJoint.h"
|
|
|
|
"src/constraint/FixedJoint.cpp"
|
|
|
|
"src/constraint/HingeJoint.h"
|
|
|
|
"src/constraint/HingeJoint.cpp"
|
|
|
|
"src/constraint/Joint.h"
|
|
|
|
"src/constraint/Joint.cpp"
|
|
|
|
"src/constraint/SliderJoint.h"
|
|
|
|
"src/constraint/SliderJoint.cpp"
|
|
|
|
"src/engine/CollisionWorld.h"
|
|
|
|
"src/engine/CollisionWorld.cpp"
|
|
|
|
"src/engine/ConstraintSolver.h"
|
|
|
|
"src/engine/ConstraintSolver.cpp"
|
|
|
|
"src/engine/ContactSolver.h"
|
|
|
|
"src/engine/ContactSolver.cpp"
|
|
|
|
"src/engine/DynamicsWorld.h"
|
|
|
|
"src/engine/DynamicsWorld.cpp"
|
|
|
|
"src/engine/EventListener.h"
|
|
|
|
"src/engine/Impulse.h"
|
|
|
|
"src/engine/Island.h"
|
|
|
|
"src/engine/Island.cpp"
|
|
|
|
"src/engine/Material.h"
|
|
|
|
"src/engine/Material.cpp"
|
|
|
|
"src/engine/OverlappingPair.h"
|
|
|
|
"src/engine/OverlappingPair.cpp"
|
|
|
|
"src/engine/Profiler.h"
|
|
|
|
"src/engine/Profiler.cpp"
|
2015-11-13 20:23:34 +00:00
|
|
|
"src/engine/Timer.h"
|
|
|
|
"src/engine/Timer.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/mathematics/mathematics.h"
|
|
|
|
"src/mathematics/mathematics_functions.h"
|
2016-01-05 17:39:22 +00:00
|
|
|
"src/mathematics/mathematics_functions.cpp"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/mathematics/Matrix2x2.h"
|
|
|
|
"src/mathematics/Matrix2x2.cpp"
|
|
|
|
"src/mathematics/Matrix3x3.h"
|
|
|
|
"src/mathematics/Matrix3x3.cpp"
|
|
|
|
"src/mathematics/Quaternion.h"
|
|
|
|
"src/mathematics/Quaternion.cpp"
|
|
|
|
"src/mathematics/Transform.h"
|
|
|
|
"src/mathematics/Transform.cpp"
|
|
|
|
"src/mathematics/Vector2.h"
|
|
|
|
"src/mathematics/Vector2.cpp"
|
|
|
|
"src/mathematics/Vector3.h"
|
2014-07-14 01:15:16 +00:00
|
|
|
"src/mathematics/Ray.h"
|
2013-09-16 18:35:23 +00:00
|
|
|
"src/mathematics/Vector3.cpp"
|
|
|
|
"src/memory/MemoryAllocator.h"
|
|
|
|
"src/memory/MemoryAllocator.cpp"
|
2014-04-11 21:50:26 +00:00
|
|
|
"src/memory/Stack.h"
|
2011-01-14 16:05:45 +00:00
|
|
|
)
|
2012-07-31 21:48:35 +00:00
|
|
|
|
2013-09-16 18:35:23 +00:00
|
|
|
# Create the library
|
2016-01-05 17:39:22 +00:00
|
|
|
ADD_LIBRARY(reactphysics3d STATIC ${REACTPHYSICS3D_SOURCES})
|
|
|
|
|
2015-04-08 18:50:31 +00:00
|
|
|
# If we need to compile the testbed application
|
|
|
|
IF(COMPILE_TESTBED)
|
|
|
|
add_subdirectory(testbed/)
|
|
|
|
ENDIF(COMPILE_TESTBED)
|
2013-03-09 07:40:22 +00:00
|
|
|
|
|
|
|
# If we need to compile the tests
|
2013-09-16 18:35:23 +00:00
|
|
|
IF(COMPILE_TESTS)
|
2013-03-09 07:40:22 +00:00
|
|
|
add_subdirectory(test/)
|
2013-09-16 18:35:23 +00:00
|
|
|
ENDIF(COMPILE_TESTS)
|