vcpkg/ports/bullet3/portfile.cmake
Stephen Just d9bb748ac8 [bullet3] Install CMake toolchain files and targets (#9098)
* [bullet3] Install CMake toolchain files and targets

* Use vcpkg_fixup_cmake_targets

* Bump version number
2020-01-06 14:44:15 -08:00

47 lines
1.3 KiB
CMake

include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO bulletphysics/bullet3
REF 2.88
SHA512 15face1940d496c96fd19a44139d11d2cbb629526c40432be4a0eef5fa9a532c842ec7318248c0359a080f2034111bf1a3c2d3a6fd789bec675bd368fac7bd93
HEAD_REF master
PATCHES cmake-fix.patch
)
set(BULLET_MULTITHREADING OFF)
if ("multithreading" IN_LIST FEATURES)
set(BULLET_MULTITHREADING ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DUSE_MSVC_RUNTIME_LIBRARY_DLL=ON
-DBUILD_DEMOS=OFF
-DBUILD_CPU_DEMOS=OFF
-DBUILD_BULLET2_DEMOS=OFF
-DBUILD_BULLET3=OFF
-DBUILD_EXTRAS=OFF
-DBUILD_UNIT_TESTS=OFF
-DINSTALL_LIBS=ON
-DBULLET2_MULTITHREADING=${BULLET_MULTITHREADING}
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "share/bullet3")
# Clean up unneeded files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/bullet/BulletInverseDynamics/details)
vcpkg_copy_pdbs()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/bullet3 RENAME copyright)