2016-11-06 01:41:40 +08:00
|
|
|
|
2016-11-08 08:24:47 +08:00
|
|
|
# Get output directory
|
|
|
|
set(PROJECT_ARCH_BITS "x64")
|
2016-11-06 01:41:40 +08:00
|
|
|
if(TRIPLET_SYSTEM_ARCH MATCHES "x86")
|
2016-11-06 21:55:26 +08:00
|
|
|
set(PROJECT_ARCH_BITS "x32")
|
2016-11-08 05:09:43 +08:00
|
|
|
elseif(TRIPLET_SYSTEM_ARCH MATCHES "arm")
|
|
|
|
message(FATAL_ERROR "ARM not supported")
|
2016-11-06 01:41:40 +08:00
|
|
|
endif(TRIPLET_SYSTEM_ARCH MATCHES "x86")
|
|
|
|
|
2017-06-10 10:34:07 +08:00
|
|
|
if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
|
|
|
message(FATAL_ERROR "Box2d only supports dynamic CRT linkage")
|
|
|
|
endif()
|
|
|
|
|
2016-11-06 01:41:40 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-05-03 19:57:23 +08:00
|
|
|
if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO erincatto/Box2D
|
|
|
|
REF 374664b2a4ce2e7c24fbad6e1ed34bebcc9ab6bc
|
2017-09-13 04:32:26 +08:00
|
|
|
SHA512 39074bab01b36104aa685bfe39b40eb903d9dfb54cc3ba8098125db5291f55a8a9e578fc59563b2e8743abbbb26f419be7ae1524e235e7bd759257f99ff96bda
|
2017-05-03 19:57:23 +08:00
|
|
|
HEAD_REF master
|
|
|
|
)
|
2016-11-06 01:41:40 +08:00
|
|
|
|
|
|
|
# Put the licence and readme files where vcpkg expects it
|
|
|
|
message(STATUS "Packaging license")
|
|
|
|
file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d)
|
|
|
|
file(COPY ${SOURCE_PATH}/Box2D/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/box2d)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/box2d/License.txt ${CURRENT_PACKAGES_DIR}/share/box2d/copyright)
|
|
|
|
message(STATUS "Packaging license done")
|
|
|
|
|
|
|
|
# Building:
|
2016-11-06 21:55:26 +08:00
|
|
|
set(OUTPUTS_PATH "${SOURCE_PATH}/Box2D/Build/vs2015/bin/${PROJECT_ARCH_BITS}")
|
|
|
|
|
2016-11-08 08:24:47 +08:00
|
|
|
vcpkg_build_msbuild(PROJECT_PATH ${SOURCE_PATH}/Box2D/Build/vs2015/Box2D.vcxproj)
|
2016-11-06 01:41:40 +08:00
|
|
|
|
2016-11-08 08:24:47 +08:00
|
|
|
message(STATUS "Packaging ${TARGET_TRIPLET}-Release lib")
|
|
|
|
file(
|
|
|
|
INSTALL ${OUTPUTS_PATH}/Release/
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/lib
|
|
|
|
FILES_MATCHING PATTERN "*.lib"
|
|
|
|
)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/Box2D.lib ${CURRENT_PACKAGES_DIR}/lib/box2d.lib)
|
|
|
|
message(STATUS "Packaging ${TARGET_TRIPLET}-Release lib done")
|
2016-11-06 01:41:40 +08:00
|
|
|
|
2016-11-08 08:24:47 +08:00
|
|
|
message(STATUS "Packaging ${TARGET_TRIPLET}-Debug lib")
|
|
|
|
file(
|
|
|
|
INSTALL ${OUTPUTS_PATH}/Debug/
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
|
|
|
|
FILES_MATCHING PATTERN "*.lib"
|
|
|
|
)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/Box2D.lib ${CURRENT_PACKAGES_DIR}/debug/lib/box2d.lib)
|
|
|
|
message(STATUS "Packaging ${TARGET_TRIPLET}-Debug lib done")
|
2016-11-06 01:41:40 +08:00
|
|
|
|
|
|
|
message(STATUS "Packaging headers")
|
|
|
|
file(
|
|
|
|
COPY ${SOURCE_PATH}/Box2D/Box2D
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/include
|
|
|
|
PATTERN "*.h"
|
|
|
|
)
|
|
|
|
message(STATUS "Packaging headers done")
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|