mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-17 07:38:16 +08:00
84 lines
2.7 KiB
CMake
84 lines
2.7 KiB
CMake
set(DIRECTXMESH_TAG dec2023)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO Microsoft/DirectXMesh
|
|
REF ${DIRECTXMESH_TAG}
|
|
SHA512 25442ec60040f2f232079b4a62a4460c8de11a881e36f5bdaeadbe98678d360141e8eca8162169941c03884cc2a05c3e20cf7fd2aef6518f6a647b7382d6d271
|
|
HEAD_REF main
|
|
)
|
|
|
|
vcpkg_check_features(
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
dx12 BUILD_DX12
|
|
spectre ENABLE_SPECTRE_MITIGATION
|
|
tools BUILD_TOOLS
|
|
)
|
|
|
|
set(EXTRA_OPTIONS -DBUILD_TESTING=OFF)
|
|
|
|
if (VCPKG_HOST_IS_LINUX)
|
|
message(WARNING "Build ${PORT} requires GCC version 9 or later")
|
|
endif()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS ${FEATURE_OPTIONS} ${EXTRA_OPTIONS}
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
vcpkg_fixup_pkgconfig()
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH share/directxmesh)
|
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxmesh/")
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
|
|
|
|
vcpkg_download_distfile(
|
|
MESHCONVERT_EXE
|
|
URLS "https://github.com/Microsoft/DirectXMesh/releases/download/${DIRECTXMESH_TAG}/meshconvert.exe"
|
|
FILENAME "meshconvert-${DIRECTXMESH_TAG}.exe"
|
|
SHA512 db2d32ec44993547881e2f14ee3403aa6133758d250ffc54b7cec9c1f15be46e5a5d847eb1cff60081bdfeaaa1e6be129475f40502c0a8c5ba2d58e5baa71691
|
|
)
|
|
|
|
file(INSTALL
|
|
"${MESHCONVERT_EXE}"
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxmesh/")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert-${DIRECTXMESH_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert.exe")
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
|
|
|
|
vcpkg_download_distfile(
|
|
MESHCONVERT_EXE
|
|
URLS "https://github.com/Microsoft/DirectXMesh/releases/download/${DIRECTXMESH_TAG}/meshconvert_arm64.exe"
|
|
FILENAME "meshconvert-${DIRECTXMESH_TAG}-arm64.exe"
|
|
SHA512 deaa61a1f24bf1ffff817a7b72b125d2402b97ca15713411eb3a5b0af0b5f2b25407be87d2fd60fb4670744656230d221183510167a1696685d2def9fa9c1532
|
|
)
|
|
|
|
file(INSTALL
|
|
"${MESHCONVERT_EXE}"
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxmesh/")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert-${DIRECTXMESH_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert.exe")
|
|
|
|
else()
|
|
|
|
vcpkg_copy_tools(
|
|
TOOL_NAMES meshconvert
|
|
SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake"
|
|
)
|
|
|
|
endif()
|
|
endif()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|