vcpkg/ports/directxtk/portfile.cmake
Chuck Walbourn f4c03ce4a8
[directxmesh, directxtex, directxtk(12), uvatlas] update ports for March 2023 releases (#30685)
* [directxmesh, directxtex, directxtk, uvatlas] update port for March 2023 releases

* vcpkg reformat

* Update baseline

* Code review feedback

* Refresh baseline
2023-04-05 16:30:02 -07:00

89 lines
3.2 KiB
CMake

set(DIRECTXTK_TAG mar2023)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
if(VCPKG_TARGET_IS_MINGW)
message(NOTICE "Building ${PORT} for MinGW requires the HLSL Compiler fxc.exe also be in the PATH. See https://aka.ms/windowssdk.")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK
REF ${DIRECTXTK_TAG}
SHA512 ed0ec9e11ed88432a43d62dff4319ed0cc5ad98e9e4ee5a29313fb06beee38d4b86243603bd041fb90e93142aa60f65db88b09c53d363b32923e54fa17575a39
HEAD_REF main
)
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
spectre ENABLE_SPECTRE_MITIGATION
tools BUILD_TOOLS
xaudio2-9 BUILD_XAUDIO_WIN10
xaudio2-8 BUILD_XAUDIO_WIN8
xaudio2redist BUILD_XAUDIO_WIN7
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS} -DBUILD_TESTING=OFF
)
vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH share/directxtk)
if("tools" IN_LIST FEATURES)
vcpkg_download_distfile(
MAKESPRITEFONT_EXE
URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/MakeSpriteFont.exe"
FILENAME "makespritefont-${DIRECTXTK_TAG}.exe"
SHA512 2a7c21356599846f10bc8adb1ec3e3ce509c9a446567ab7195e998a428e3a62629e8f6d4b7bd9fc3793a51f6eb61597b5feba49f3464ea3e4529d0991701e780
)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtk/")
file(INSTALL "${MAKESPRITEFONT_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/")
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk/makespritefont-${DIRECTXTK_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk/makespritefont.exe")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
vcpkg_download_distfile(
XWBTOOL_EXE
URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/XWBTool.exe"
FILENAME "xwbtool-${DIRECTXTK_TAG}.exe"
SHA512 9bc9279767d6379501ec9d851cda52556eb1e96f583a162b4fad93f96985b18b2fe9d9c6eeb3f5f16b42ce2655ae3045bfe0ea0cb4aca425fe09bc079ad6a70d
)
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/")
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool-${DIRECTXTK_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool.exe")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL arm64)
vcpkg_download_distfile(
XWBTOOL_EXE
URLS "https://github.com/Microsoft/DirectXTK/releases/download/${DIRECTXTK_TAG}/XWBTool_arm64.exe"
FILENAME "xwbtool-${DIRECTXTK_TAG}-arm64.exe"
SHA512 b49cbe9823182b600496a449a2ff5acd08491615584c523ede4506880cb9b293cedf0b350f186ed4ef53e4795a89d1b0331559fee59ee533751086d7bb4c9e54
)
file(INSTALL "${XWBTOOL_EXE}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtk/")
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool-${DIRECTXTK_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtk/xwbtool.exe")
else()
vcpkg_copy_tools(
TOOL_NAMES XWBTool
SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake"
)
endif()
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)