vcpkg/ports/directxtk/portfile.cmake

90 lines
3.2 KiB
CMake
Raw Normal View History

set(DIRECTXTK_TAG jun2023)
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 de98429af5851fafdab4b24b38d0230798eab38c5fee291ea43ef46dabe275e3476d1449f94ebead53d5a4f361257218b165af37f96114cec5890403a044d600
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 1b78df0fe1f1de0e3796c8ac3b3b99f7d44dc955ebd107791bda637a27a94a364cbf974a240a5ac02a79ff8bcc8ee74528bca502e71666d0d99ce28a0cb88fd1
)
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 b200690f7b81cdf902ec8c84a2be315858796c7ce01fbf9971377a08b8f7e0211415bc4829944041b57ed6a786f2ace0f4991cc8f51241bb7351defcfc9c34de
)
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 ba338c19e4a224cac3b31ed82bf5174f072186845ba5d70aa50a5c485faf6e463559613da213a55c8859e7b6615bfaa8819dd9e79bf955df67973e68fbefcad0
)
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 "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")