vcpkg/ports/directxmesh/portfile.cmake

81 lines
2.7 KiB
CMake
Raw Normal View History

set(DIRECTXMESH_TAG oct2023)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXMesh
REF ${DIRECTXMESH_TAG}
SHA512 e02471cc0d3a1f2f5c6effe23cea0909a6096b97011885af4b6436e070a11d5f5d5033f0df2c9103cef182b9666c7d17274c519e4f35099cb602a317a9e3bed5
HEAD_REF main
2017-01-11 22:42:37 +08:00
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
dx12 BUILD_DX12
spectre ENABLE_SPECTRE_MITIGATION
tools BUILD_TOOLS
2017-01-11 22:42:37 +08:00
)
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} -DBUILD_TESTING=OFF
2017-01-11 22:42:37 +08:00
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH share/directxmesh)
2017-01-11 22:42:37 +08:00
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 24385c74fa4b32c41bb2d6713ffe2fc78ef899d4f9f55bdb1a9d0a362858c019e6f59b932c03a7c66298362aed09b845f409dcd659dc79c05cb6e00c04db52ae
)
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 32b64534f7dc7bbf41c5d7ad154d401dbfec2442ebb62969b2acef94595fe4f07e092e1e201aebb7596b47216904ee9e7647911c2a52efdc588d9abc1d691785
)
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()
2017-01-11 22:42:37 +08:00
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")