2011-01-14 16:05:45 +00:00
|
|
|
# Minimum cmake version required
|
2020-05-11 10:38:59 +00:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
2011-01-14 16:05:45 +00:00
|
|
|
|
|
|
|
# Project configuration
|
2020-05-12 21:59:54 +00:00
|
|
|
project(ReactPhysics3D VERSION 0.7.1 LANGUAGES CXX)
|
2018-04-06 15:23:44 +00:00
|
|
|
|
|
|
|
# In order to install libraries into correct locations on all platforms.
|
|
|
|
include(GNUInstallDirs)
|
2012-07-31 21:48:35 +00:00
|
|
|
|
2020-05-11 10:38:59 +00:00
|
|
|
# Set default build type
|
|
|
|
set(default_build_type "Release")
|
|
|
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
|
|
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
|
|
|
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
|
|
|
STRING "Choose the type of build." FORCE)
|
|
|
|
# Set the possible values of build type for cmake-gui
|
|
|
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
|
|
|
|
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
|
|
|
endif()
|
2012-07-31 21:48:35 +00:00
|
|
|
|
2018-04-04 19:53:01 +00:00
|
|
|
# CMake modules path
|
2020-05-11 10:38:59 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
|
2018-04-04 19:53:01 +00:00
|
|
|
|
2018-04-06 15:23:44 +00:00
|
|
|
# Enable testing
|
2020-05-11 10:38:59 +00:00
|
|
|
enable_testing()
|
2015-07-12 10:11:20 +00:00
|
|
|
|
2012-07-31 21:48:35 +00:00
|
|
|
# Options
|
2020-05-11 10:38:59 +00:00
|
|
|
option(RP3D_COMPILE_TESTBED "Select this if you want to build the testbed application with demos" OFF)
|
|
|
|
option(RP3D_COMPILE_TESTS "Select this if you want to build the unit tests" OFF)
|
|
|
|
option(RP3D_PROFILING_ENABLED "Select this if you want to compile for performanace profiling" OFF)
|
|
|
|
option(RP3D_CODE_COVERAGE_ENABLED "Select this if you need to build for code coverage calculation" OFF)
|
|
|
|
option(RP3D_DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating values" OFF)
|
2016-03-03 16:25:53 +00:00
|
|
|
|
2020-05-11 10:38:59 +00:00
|
|
|
if(RP3D_CODE_COVERAGE_ENABLED)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
2018-04-04 19:53:01 +00:00
|
|
|
INCLUDE(CodeCoverage)
|
|
|
|
SETUP_TARGET_FOR_COVERAGE(${PROJECT_NAME}_coverage tests coverage)
|
2020-05-11 10:38:59 +00:00
|
|
|
endif()
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
|
|
|
|
endif()
|
2011-01-14 16:05:45 +00:00
|
|
|
|
2020-03-18 06:28:34 +00:00
|
|
|
# Headers filen1s
|
2020-05-11 10:38:59 +00:00
|
|
|
set (REACTPHYSICS3D_HEADERS
|
2020-03-18 06:28:34 +00:00
|
|
|
"include/reactphysics3d/configuration.h"
|
|
|
|
"include/reactphysics3d/decimal.h"
|
|
|
|
"include/reactphysics3d/reactphysics3d.h"
|
|
|
|
"include/reactphysics3d/body/CollisionBody.h"
|
|
|
|
"include/reactphysics3d/body/RigidBody.h"
|
|
|
|
"include/reactphysics3d/collision/ContactPointInfo.h"
|
|
|
|
"include/reactphysics3d/collision/ContactManifoldInfo.h"
|
|
|
|
"include/reactphysics3d/collision/ContactPair.h"
|
|
|
|
"include/reactphysics3d/collision/broadphase/DynamicAABBTree.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/CollisionDispatch.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/GJK/VoronoiSimplex.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/GJK/GJKAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/SAT/SATAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/NarrowPhaseAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/SphereVsSphereAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/CapsuleVsCapsuleAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/SphereVsCapsuleAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/SphereVsConvexPolyhedronAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/CapsuleVsConvexPolyhedronAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/ConvexPolyhedronVsConvexPolyhedronAlgorithm.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/NarrowPhaseInput.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/NarrowPhaseInfoBatch.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/SphereVsSphereNarrowPhaseInfoBatch.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/CapsuleVsCapsuleNarrowPhaseInfoBatch.h"
|
|
|
|
"include/reactphysics3d/collision/narrowphase/SphereVsCapsuleNarrowPhaseInfoBatch.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/AABB.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/ConvexShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/ConvexPolyhedronShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/ConcaveShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/BoxShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/CapsuleShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/CollisionShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/ConvexMeshShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/SphereShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/TriangleShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/ConcaveMeshShape.h"
|
|
|
|
"include/reactphysics3d/collision/shapes/HeightFieldShape.h"
|
|
|
|
"include/reactphysics3d/collision/RaycastInfo.h"
|
|
|
|
"include/reactphysics3d/collision/Collider.h"
|
|
|
|
"include/reactphysics3d/collision/TriangleVertexArray.h"
|
|
|
|
"include/reactphysics3d/collision/PolygonVertexArray.h"
|
|
|
|
"include/reactphysics3d/collision/TriangleMesh.h"
|
|
|
|
"include/reactphysics3d/collision/PolyhedronMesh.h"
|
|
|
|
"include/reactphysics3d/collision/HalfEdgeStructure.h"
|
|
|
|
"include/reactphysics3d/collision/ContactManifold.h"
|
|
|
|
"include/reactphysics3d/constraint/BallAndSocketJoint.h"
|
|
|
|
"include/reactphysics3d/constraint/ContactPoint.h"
|
|
|
|
"include/reactphysics3d/constraint/FixedJoint.h"
|
|
|
|
"include/reactphysics3d/constraint/HingeJoint.h"
|
|
|
|
"include/reactphysics3d/constraint/Joint.h"
|
|
|
|
"include/reactphysics3d/constraint/SliderJoint.h"
|
|
|
|
"include/reactphysics3d/engine/Entity.h"
|
|
|
|
"include/reactphysics3d/engine/EntityManager.h"
|
|
|
|
"include/reactphysics3d/engine/PhysicsCommon.h"
|
|
|
|
"include/reactphysics3d/systems/ConstraintSolverSystem.h"
|
|
|
|
"include/reactphysics3d/systems/ContactSolverSystem.h"
|
|
|
|
"include/reactphysics3d/systems/DynamicsSystem.h"
|
|
|
|
"include/reactphysics3d/systems/CollisionDetectionSystem.h"
|
|
|
|
"include/reactphysics3d/systems/SolveBallAndSocketJointSystem.h"
|
|
|
|
"include/reactphysics3d/systems/SolveFixedJointSystem.h"
|
|
|
|
"include/reactphysics3d/systems/SolveHingeJointSystem.h"
|
|
|
|
"include/reactphysics3d/systems/SolveSliderJointSystem.h"
|
|
|
|
"include/reactphysics3d/engine/PhysicsWorld.h"
|
|
|
|
"include/reactphysics3d/engine/EventListener.h"
|
|
|
|
"include/reactphysics3d/engine/Island.h"
|
|
|
|
"include/reactphysics3d/engine/Islands.h"
|
|
|
|
"include/reactphysics3d/engine/Material.h"
|
|
|
|
"include/reactphysics3d/engine/OverlappingPairs.h"
|
|
|
|
"include/reactphysics3d/engine/Timer.h"
|
|
|
|
"include/reactphysics3d/systems/BroadPhaseSystem.h"
|
|
|
|
"include/reactphysics3d/components/Components.h"
|
|
|
|
"include/reactphysics3d/components/CollisionBodyComponents.h"
|
|
|
|
"include/reactphysics3d/components/RigidBodyComponents.h"
|
|
|
|
"include/reactphysics3d/components/TransformComponents.h"
|
|
|
|
"include/reactphysics3d/components/ColliderComponents.h"
|
|
|
|
"include/reactphysics3d/components/JointComponents.h"
|
|
|
|
"include/reactphysics3d/components/BallAndSocketJointComponents.h"
|
|
|
|
"include/reactphysics3d/components/FixedJointComponents.h"
|
|
|
|
"include/reactphysics3d/components/HingeJointComponents.h"
|
|
|
|
"include/reactphysics3d/components/SliderJointComponents.h"
|
|
|
|
"include/reactphysics3d/collision/CollisionCallback.h"
|
|
|
|
"include/reactphysics3d/collision/OverlapCallback.h"
|
|
|
|
"include/reactphysics3d/mathematics/mathematics.h"
|
|
|
|
"include/reactphysics3d/mathematics/mathematics_functions.h"
|
|
|
|
"include/reactphysics3d/mathematics/Matrix2x2.h"
|
|
|
|
"include/reactphysics3d/mathematics/Matrix3x3.h"
|
|
|
|
"include/reactphysics3d/mathematics/Quaternion.h"
|
|
|
|
"include/reactphysics3d/mathematics/Transform.h"
|
|
|
|
"include/reactphysics3d/mathematics/Vector2.h"
|
|
|
|
"include/reactphysics3d/mathematics/Vector3.h"
|
|
|
|
"include/reactphysics3d/mathematics/Ray.h"
|
|
|
|
"include/reactphysics3d/memory/MemoryAllocator.h"
|
|
|
|
"include/reactphysics3d/memory/PoolAllocator.h"
|
|
|
|
"include/reactphysics3d/memory/SingleFrameAllocator.h"
|
|
|
|
"include/reactphysics3d/memory/HeapAllocator.h"
|
|
|
|
"include/reactphysics3d/memory/DefaultAllocator.h"
|
|
|
|
"include/reactphysics3d/memory/MemoryManager.h"
|
|
|
|
"include/reactphysics3d/containers/Stack.h"
|
|
|
|
"include/reactphysics3d/containers/LinkedList.h"
|
|
|
|
"include/reactphysics3d/containers/List.h"
|
|
|
|
"include/reactphysics3d/containers/Map.h"
|
|
|
|
"include/reactphysics3d/containers/Set.h"
|
|
|
|
"include/reactphysics3d/containers/Pair.h"
|
|
|
|
"include/reactphysics3d/containers/Deque.h"
|
|
|
|
"include/reactphysics3d/utils/Profiler.h"
|
|
|
|
"include/reactphysics3d/utils/Logger.h"
|
2020-04-26 16:41:59 +00:00
|
|
|
"include/reactphysics3d/utils/DefaultLogger.h"
|
2020-05-05 22:34:56 +00:00
|
|
|
"include/reactphysics3d/utils/DebugRenderer.h"
|
2018-04-06 15:23:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# Source files
|
2020-05-11 10:38:59 +00:00
|
|
|
set (REACTPHYSICS3D_SOURCES
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/body/CollisionBody.cpp"
|
|
|
|
"src/body/RigidBody.cpp"
|
|
|
|
"src/collision/broadphase/DynamicAABBTree.cpp"
|
2018-11-05 17:34:46 +00:00
|
|
|
"src/collision/narrowphase/CollisionDispatch.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/collision/narrowphase/GJK/VoronoiSimplex.cpp"
|
|
|
|
"src/collision/narrowphase/GJK/GJKAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/SAT/SATAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/SphereVsSphereAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/CapsuleVsCapsuleAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/SphereVsCapsuleAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/SphereVsConvexPolyhedronAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/CapsuleVsConvexPolyhedronAlgorithm.cpp"
|
|
|
|
"src/collision/narrowphase/ConvexPolyhedronVsConvexPolyhedronAlgorithm.cpp"
|
2018-11-05 17:34:46 +00:00
|
|
|
"src/collision/narrowphase/NarrowPhaseInput.cpp"
|
2018-11-27 06:27:38 +00:00
|
|
|
"src/collision/narrowphase/NarrowPhaseInfoBatch.cpp"
|
|
|
|
"src/collision/narrowphase/SphereVsSphereNarrowPhaseInfoBatch.cpp"
|
2018-11-29 06:08:39 +00:00
|
|
|
"src/collision/narrowphase/CapsuleVsCapsuleNarrowPhaseInfoBatch.cpp"
|
2018-11-29 16:33:27 +00:00
|
|
|
"src/collision/narrowphase/SphereVsCapsuleNarrowPhaseInfoBatch.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/collision/shapes/AABB.cpp"
|
|
|
|
"src/collision/shapes/ConvexShape.cpp"
|
|
|
|
"src/collision/shapes/ConvexPolyhedronShape.cpp"
|
|
|
|
"src/collision/shapes/ConcaveShape.cpp"
|
|
|
|
"src/collision/shapes/BoxShape.cpp"
|
|
|
|
"src/collision/shapes/CapsuleShape.cpp"
|
|
|
|
"src/collision/shapes/CollisionShape.cpp"
|
|
|
|
"src/collision/shapes/ConvexMeshShape.cpp"
|
|
|
|
"src/collision/shapes/SphereShape.cpp"
|
|
|
|
"src/collision/shapes/TriangleShape.cpp"
|
|
|
|
"src/collision/shapes/ConcaveMeshShape.cpp"
|
|
|
|
"src/collision/shapes/HeightFieldShape.cpp"
|
|
|
|
"src/collision/RaycastInfo.cpp"
|
2020-01-20 20:22:46 +00:00
|
|
|
"src/collision/Collider.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/collision/TriangleVertexArray.cpp"
|
|
|
|
"src/collision/PolygonVertexArray.cpp"
|
|
|
|
"src/collision/TriangleMesh.cpp"
|
|
|
|
"src/collision/PolyhedronMesh.cpp"
|
|
|
|
"src/collision/HalfEdgeStructure.cpp"
|
|
|
|
"src/collision/ContactManifold.cpp"
|
|
|
|
"src/constraint/BallAndSocketJoint.cpp"
|
|
|
|
"src/constraint/ContactPoint.cpp"
|
|
|
|
"src/constraint/FixedJoint.cpp"
|
|
|
|
"src/constraint/HingeJoint.cpp"
|
|
|
|
"src/constraint/Joint.cpp"
|
|
|
|
"src/constraint/SliderJoint.cpp"
|
2019-12-12 06:13:27 +00:00
|
|
|
"src/engine/PhysicsCommon.cpp"
|
2019-08-08 15:45:22 +00:00
|
|
|
"src/systems/ConstraintSolverSystem.cpp"
|
|
|
|
"src/systems/ContactSolverSystem.cpp"
|
|
|
|
"src/systems/DynamicsSystem.cpp"
|
2019-08-09 05:13:15 +00:00
|
|
|
"src/systems/CollisionDetectionSystem.cpp"
|
2019-08-15 16:12:46 +00:00
|
|
|
"src/systems/SolveBallAndSocketJointSystem.cpp"
|
2019-10-02 15:48:28 +00:00
|
|
|
"src/systems/SolveFixedJointSystem.cpp"
|
2019-10-05 15:45:35 +00:00
|
|
|
"src/systems/SolveHingeJointSystem.cpp"
|
2019-10-07 18:50:37 +00:00
|
|
|
"src/systems/SolveSliderJointSystem.cpp"
|
2020-01-27 16:46:00 +00:00
|
|
|
"src/engine/PhysicsWorld.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/engine/Island.cpp"
|
|
|
|
"src/engine/Material.cpp"
|
2019-11-09 22:55:54 +00:00
|
|
|
"src/engine/OverlappingPairs.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/engine/Timer.cpp"
|
2018-12-23 22:18:05 +00:00
|
|
|
"src/engine/Entity.cpp"
|
|
|
|
"src/engine/EntityManager.cpp"
|
2019-03-04 16:29:27 +00:00
|
|
|
"src/systems/BroadPhaseSystem.cpp"
|
2019-03-16 06:50:34 +00:00
|
|
|
"src/components/Components.cpp"
|
2019-07-15 15:44:45 +00:00
|
|
|
"src/components/CollisionBodyComponents.cpp"
|
2019-07-16 05:15:13 +00:00
|
|
|
"src/components/RigidBodyComponents.cpp"
|
2018-12-23 22:18:05 +00:00
|
|
|
"src/components/TransformComponents.cpp"
|
2020-01-20 20:22:46 +00:00
|
|
|
"src/components/ColliderComponents.cpp"
|
2019-08-15 16:12:46 +00:00
|
|
|
"src/components/JointComponents.cpp"
|
2019-09-02 12:15:03 +00:00
|
|
|
"src/components/BallAndSocketJointComponents.cpp"
|
2019-09-04 10:44:42 +00:00
|
|
|
"src/components/FixedJointComponents.cpp"
|
2019-09-11 19:13:45 +00:00
|
|
|
"src/components/HingeJointComponents.cpp"
|
2019-09-13 05:15:48 +00:00
|
|
|
"src/components/SliderJointComponents.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/collision/CollisionCallback.cpp"
|
2019-06-25 21:26:06 +00:00
|
|
|
"src/collision/OverlapCallback.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/mathematics/mathematics_functions.cpp"
|
|
|
|
"src/mathematics/Matrix2x2.cpp"
|
|
|
|
"src/mathematics/Matrix3x3.cpp"
|
|
|
|
"src/mathematics/Quaternion.cpp"
|
|
|
|
"src/mathematics/Transform.cpp"
|
|
|
|
"src/mathematics/Vector2.cpp"
|
|
|
|
"src/mathematics/Vector3.cpp"
|
2019-11-27 21:41:38 +00:00
|
|
|
"src/memory/PoolAllocator.cpp"
|
|
|
|
"src/memory/SingleFrameAllocator.cpp"
|
2020-01-13 16:02:59 +00:00
|
|
|
"src/memory/HeapAllocator.cpp"
|
2018-04-06 15:23:44 +00:00
|
|
|
"src/memory/MemoryManager.cpp"
|
|
|
|
"src/utils/Profiler.cpp"
|
2020-04-26 16:41:59 +00:00
|
|
|
"src/utils/DefaultLogger.cpp"
|
2020-05-05 22:34:56 +00:00
|
|
|
"src/utils/DebugRenderer.cpp"
|
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
|
2020-05-11 10:38:59 +00:00
|
|
|
add_library(reactphysics3d ${REACTPHYSICS3D_HEADERS} ${REACTPHYSICS3D_SOURCES})
|
|
|
|
|
2020-05-12 21:59:54 +00:00
|
|
|
# Creates an Alias Target, such that "ReactPhysics3D::reactphysics3d" can be used
|
|
|
|
# to refer to "reactphysics3d" in subsequent commands
|
|
|
|
add_library(ReactPhysics3D::reactphysics3d ALIAS reactphysics3d)
|
|
|
|
|
2020-05-11 10:38:59 +00:00
|
|
|
# C++11 compiler features
|
|
|
|
target_compile_features(reactphysics3d PUBLIC cxx_std_11)
|
|
|
|
set_target_properties(reactphysics3d PROPERTIES CXX_EXTENSIONS OFF)
|
|
|
|
|
|
|
|
# Compile with warning messages
|
2020-05-13 17:07:04 +00:00
|
|
|
target_compile_options(reactphysics3d PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/W4> # for Visual Studio
|
|
|
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -pedantic> # Other compilers
|
|
|
|
)
|
2018-04-06 15:23:44 +00:00
|
|
|
|
2020-05-12 21:59:54 +00:00
|
|
|
# Library headers
|
2020-05-11 10:38:59 +00:00
|
|
|
target_include_directories(reactphysics3d PUBLIC
|
2020-03-18 06:28:34 +00:00
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
2018-04-06 15:23:44 +00:00
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
)
|
2016-01-05 17:39:22 +00:00
|
|
|
|
2015-04-08 18:50:31 +00:00
|
|
|
# If we need to compile the testbed application
|
2020-05-11 10:38:59 +00:00
|
|
|
if(RP3D_COMPILE_TESTBED)
|
2015-04-08 18:50:31 +00:00
|
|
|
add_subdirectory(testbed/)
|
2020-05-11 10:38:59 +00:00
|
|
|
endif()
|
2013-03-09 07:40:22 +00:00
|
|
|
|
|
|
|
# If we need to compile the tests
|
2020-05-11 10:38:59 +00:00
|
|
|
if(RP3D_COMPILE_TESTS)
|
2013-03-09 07:40:22 +00:00
|
|
|
add_subdirectory(test/)
|
2020-05-11 10:38:59 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Enable profiling if necessary
|
|
|
|
if(RP3D_PROFILING_ENABLED)
|
|
|
|
target_compile_definitions(reactphysics3d PUBLIC IS_RP3D_PROFILING_ENABLED)
|
|
|
|
endif()
|
2018-04-06 15:23:44 +00:00
|
|
|
|
2020-05-11 10:38:59 +00:00
|
|
|
# Enable double precision if necessary
|
|
|
|
if(RP3D_DOUBLE_PRECISION_ENABLED)
|
|
|
|
target_compile_definitions(reactphysics3d PUBLIC IS_RP3D_DOUBLE_PRECISION_ENABLED)
|
|
|
|
endif()
|
2018-07-31 18:12:15 +00:00
|
|
|
|
2018-08-04 05:25:32 +00:00
|
|
|
# Version number and soname for the library
|
2020-05-11 10:38:59 +00:00
|
|
|
set_target_properties(reactphysics3d PROPERTIES
|
2019-07-01 06:42:27 +00:00
|
|
|
VERSION "0.7.1"
|
2018-08-04 05:25:32 +00:00
|
|
|
SOVERSION "0.7"
|
|
|
|
)
|
|
|
|
|
2020-02-19 11:48:14 +00:00
|
|
|
# Install target (install library only, not headers)
|
2020-05-11 10:38:59 +00:00
|
|
|
install(TARGETS reactphysics3d
|
2020-05-12 21:59:54 +00:00
|
|
|
EXPORT reactphysics3d-targets
|
2018-07-31 22:11:41 +00:00
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2018-04-06 15:23:44 +00:00
|
|
|
)
|
2020-03-18 06:28:34 +00:00
|
|
|
|
2020-05-12 21:59:54 +00:00
|
|
|
# Install the headers separately (because INSTALL(TARGETS ... PUBLIC_HEADER DESTINATION ...) does
|
|
|
|
# not support subfolders
|
2020-05-11 10:38:59 +00:00
|
|
|
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
2020-05-12 21:59:54 +00:00
|
|
|
|
|
|
|
# This is required so that the exported target has the name JSONUtils and not jsonutils
|
|
|
|
set_target_properties(reactphysics3d PROPERTIES EXPORT_NAME ReactPhysics3D)
|
|
|
|
|
|
|
|
# Give CMake access to the version number of the library so that the user is able to use the find_package() function
|
|
|
|
# with a given version number to select the version of the library he/she wants to use. This will create a
|
|
|
|
# "ReactPhysics3DConfigVersion.cmake" file that will later be copied into the install destination folder (see below)
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
write_basic_package_version_file(
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ReactPhysics3DConfigVersion.cmake
|
|
|
|
VERSION ${PROJECT_VERSION}
|
|
|
|
COMPATIBILITY AnyNewerVersion
|
|
|
|
)
|
|
|
|
|
|
|
|
# When the user runs "make install", this will export the targets into
|
|
|
|
# a "ReactPhysics3DConfig.cmake" file in the install destination
|
|
|
|
install(EXPORT reactphysics3d-targets
|
|
|
|
FILE
|
|
|
|
ReactPhysics3DConfig.cmake
|
|
|
|
NAMESPACE
|
|
|
|
ReactPhysics3D::
|
|
|
|
DESTINATION
|
|
|
|
${CMAKE_INSTALL_LIBDIR}/cmake/ReactPhysics3D
|
|
|
|
)
|
|
|
|
|
|
|
|
# When the user runs "make install", this will copy the "ReactPhysics3DConfigVersion.cmake" file
|
|
|
|
# we have previously created into the install destination
|
|
|
|
install(FILES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/ReactPhysics3DConfigVersion.cmake
|
|
|
|
DESTINATION lib/cmake/ReactPhysics3D
|
|
|
|
)
|