vcpkg/ports/directxmesh/portfile.cmake
Chuck Walbourn 339d01f19c
[directxtk, directxtk12, directxtex, directxmesh, uvatlas] ports updated for September 2021 release (#20457)
* Update for September 2021 GitHub releases

* Update directx tool kit ports

* Update versions

* Convert directxmesh and uvatlas to vcpkg-cmake

* Refresh version hash
2021-10-01 17:03:20 -07:00

65 lines
1.9 KiB
CMake

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_fail_port_install(ON_TARGET "OSX")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXMesh
REF sept2021
SHA512 e07f944080dc7e0ffe154061057a81d7caee3c4612b9261ba5a4812b3cb45571dee0a1c9b01824ccfbe9566132eadef30b80164fefe6a3ead60a3762566e2604
HEAD_REF master
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
dx12 BUILD_DX12
)
if (VCPKG_HOST_IS_LINUX)
message(WARNING "Build ${PORT} requires GCC version 9 or later")
endif()
if(VCPKG_TARGET_IS_UWP)
set(EXTRA_OPTIONS -DBUILD_TOOLS=OFF)
else()
set(EXTRA_OPTIONS -DBUILD_TOOLS=ON)
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS ${FEATURE_OPTIONS} ${EXTRA_OPTIONS}
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
if((VCPKG_HOST_IS_WINDOWS) AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64))
vcpkg_download_distfile(
MESHCONVERT_EXE
URLS "https://github.com/Microsoft/DirectXMesh/releases/download/sept2021/meshconvert.exe"
FILENAME "meshconvert-sept2021.exe"
SHA512 9d527b95d3a37604ac3a4c05f8ef44e81cfd8044dd44eddc531116ee5110443679787e4719b0504dc60e406e28396e1f553388cf261b3df81103bd03391c32af
)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxmesh/")
file(INSTALL
${MESHCONVERT_EXE}
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/directxmesh/)
file(RENAME ${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert-sept2021.exe ${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert.exe)
elseif((VCPKG_TARGET_IS_WINDOWS) AND (NOT VCPKG_TARGET_IS_UWP))
vcpkg_copy_tools(
TOOL_NAMES meshconvert
SEARCH_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake
)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)