2021-01-25 17:54:04 +08:00
|
|
|
vcpkg_fail_port_install(MESSAGE "ms-gltf currently only supports Windows and Mac platforms" ON_TARGET "linux" "ios")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO microsoft/glTF-SDK
|
2021-09-08 12:09:06 +08:00
|
|
|
REF ac3e70392feb6aef18a07314669f6af2ebc72787 # r1.9.5.4
|
|
|
|
SHA512 389b801ddc6f0b29269bcd1215fa9e63fe46a1f1a8778125c6439e34fe0925d5534b1cdbea30824a4a8aa008015124dc7cc4558daa9522fc6d85e00e8e41e4a9
|
2021-01-25 17:54:04 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
fix-install.patch
|
|
|
|
fix-apple-filesystem.patch
|
|
|
|
)
|
|
|
|
|
|
|
|
# note: Test/Sample executables won't be installed
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-09-08 12:09:06 +08:00
|
|
|
FEATURES
|
2021-01-25 17:54:04 +08:00
|
|
|
test ENABLE_UNIT_TESTS
|
|
|
|
samples ENABLE_SAMPLES
|
|
|
|
)
|
|
|
|
|
|
|
|
# note: Platform-native buildsystem will be more helpful to launch/debug the tests/samples.
|
2021-09-08 12:09:06 +08:00
|
|
|
# note: The PDB file path is making Ninja fails to install.
|
2021-01-25 17:54:04 +08:00
|
|
|
# For Windows, we rely on /MP. The other platforms should be able to build with PREFER_NINJA.
|
2021-09-08 12:09:06 +08:00
|
|
|
set(WINDOWS_USE_MSBUILD)
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
set(WINDOWS_USE_MSBUILD "WINDOWS_USE_MSBUILD")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
${WINDOWS_USE_MSBUILD}
|
2021-01-25 17:54:04 +08:00
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
)
|
2021-09-08 12:09:06 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-01-25 17:54:04 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2021-09-08 12:09:06 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2021-01-25 17:54:04 +08:00
|
|
|
endif()
|
2021-09-08 12:09:06 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|