2011-01-14 16:05:45 +00:00
|
|
|
# Minimum cmake version required
|
2012-07-31 21:48:35 +00:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
2011-01-14 16:05:45 +00:00
|
|
|
|
|
|
|
# Project configuration
|
2012-07-31 21:48:35 +00:00
|
|
|
PROJECT(REACTPHYSICS3D)
|
|
|
|
|
|
|
|
# Where to build the library
|
|
|
|
SET(LIBRARY_OUTPUT_PATH lib/)
|
|
|
|
|
2013-04-26 22:15:25 +00:00
|
|
|
# Where to find the module to find special packages/libraries
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
|
|
|
|
2012-07-31 21:48:35 +00:00
|
|
|
# Options
|
|
|
|
OPTION(COMPILE_EXAMPLES "Select this if you want to build the examples" 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)
|
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-03-24 18:45:48 +00:00
|
|
|
IF (PROFILING_ENABLED)
|
|
|
|
ADD_DEFINITIONS(-DIS_PROFILING_ACTIVE)
|
|
|
|
ENDIF (PROFILING_ENABLED)
|
|
|
|
|
2013-05-12 12:08:30 +00:00
|
|
|
IF (DOUBLE_PRECISION_ENABLED)
|
|
|
|
ADD_DEFINITIONS(-DIS_DOUBLE_PRECISION_ENABLED)
|
|
|
|
ENDIF (DOUBLE_PRECISION_ENABLED)
|
|
|
|
|
2011-01-14 16:05:45 +00:00
|
|
|
# Library configuration
|
|
|
|
file (
|
|
|
|
GLOB_RECURSE
|
|
|
|
source_files
|
|
|
|
src/*
|
|
|
|
)
|
|
|
|
|
2012-07-31 21:48:35 +00:00
|
|
|
# Require the reactphysics3d code to be compiled in a static library
|
|
|
|
ADD_LIBRARY (
|
2011-01-14 16:05:45 +00:00
|
|
|
reactphysics3d
|
|
|
|
STATIC
|
|
|
|
${source_files}
|
|
|
|
)
|
2012-07-31 21:48:35 +00:00
|
|
|
|
|
|
|
# If we need to compile the examples
|
|
|
|
IF (COMPILE_EXAMPLES)
|
2013-04-14 19:32:40 +00:00
|
|
|
add_subdirectory(examples/)
|
2012-07-31 21:48:35 +00:00
|
|
|
ENDIF (COMPILE_EXAMPLES)
|
2013-03-09 07:40:22 +00:00
|
|
|
|
|
|
|
# If we need to compile the tests
|
|
|
|
IF (COMPILE_TESTS)
|
|
|
|
add_subdirectory(test/)
|
|
|
|
ENDIF (COMPILE_TESTS)
|