forked from ivansafrin/Polycode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ExternalBox2D.cmake
34 lines (26 loc) · 1.04 KB
/
ExternalBox2D.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
INCLUDE(ExternalProject)
SET(box2d_PREFIX ${PROJECT_BINARY_DIR}/box2d)
# Needs fpic to link in shared lib on Linux
#IF(CMAKE_COMPILER_IS_GNUCXX)
# SET(box2d_CXX_ARGS -DCMAKE_CXX_FLAGS=-fPIC)
#ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET(box2d_CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
-DCMAKE_DEBUG_POSTFIX=_d
-DBOX2D_INSTALL=ON
-DBOX2D_BUILD_EXAMPLES=OFF
${box2d_CXX_ARGS}
)
ExternalProject_Add(box2d
PREFIX ${box2d_PREFIX}
DOWNLOAD_DIR ${POLYCODE_DEPS_DOWNLOAD_DIR}
URL http://box2d.googlecode.com/files/Box2D_v2.1.2.zip
URL_MD5 59d142cd8d4d73e8832c7b67591f590c
# Box2D's source isn't in the top level directory so add a dummy file to set cmake right
PATCH_COMMAND cmake -E echo ADD_SUBDIRECTORY(Box2D) > <SOURCE_DIR>/CMakeLists.txt
INSTALL_DIR ${POLYCODE_DEPS_MODULES_PREFIX}
CMAKE_ARGS ${box2d_CMAKE_ARGS}
)