[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / chipmunk2d / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.7)
2
3 project(chipmunk)
4
5 # to change the prefix, run cmake with the parameter:
6 #   -D CMAKE_INSTALL_PREFIX=/my/prefix
7
8 # to change the build type, run cmake with the parameter:
9 #   -D CMAKE_BUILD_TYPE=<build-type>
10 # run "cmake --help-variable CMAKE_BUILD_TYPE" for details
11 if(NOT CMAKE_BUILD_TYPE)
12   SET(CMAKE_BUILD_TYPE Release CACHE STRING
13       "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
14       FORCE)
15 endif()
16
17 # to manually select install locations of libraries and executables
18 #   -D LIB_INSTALL_DIR mylib
19 #   -D BIN_INSTALL_DIR newbin
20 set(LIB_INSTALL_DIR ${LIB_DIR} CACHE STRING "Install location of libraries")
21 set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables")
22
23 # other options for the build, you can i.e. activate the shared library by passing
24 #   -D BUILD_SHARED=ON
25 # to cmake. Other options analog
26 if(ANDROID)
27   option(BUILD_SHARED "Build and install the shared library" ON)
28   option(BUILD_STATIC "Build as static library" ON)
29   option(INSTALL_STATIC "Install the static library" OFF)
30 else()
31   option(BUILD_SHARED "Build and install the shared library" ON)
32   option(BUILD_STATIC "Build as static library" ON)
33   option(INSTALL_STATIC "Install the static library" ON)
34 endif()
35
36 if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
37   option(FORCE_CLANG_BLOCKS "Force enable Clang blocks" YES)
38 endif()
39
40 if(INSTALL_STATIC)
41   set(BUILD_STATIC ON FORCE)
42 endif()
43
44 if(NOT MSVC)
45   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") # always use gnu99
46   if(FORCE_CLANG_BLOCKS)
47     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fblocks")
48   endif()
49   set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffast-math") # extend release-profile with fast-math
50   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall") # extend debug-profile with -Wall
51 endif()
52
53 add_subdirectory(src)