diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/directxtex | |
Diffstat (limited to 'vcpkg/ports/directxtex')
| -rw-r--r-- | vcpkg/ports/directxtex/portfile.cmake | 147 | ||||
| -rw-r--r-- | vcpkg/ports/directxtex/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/directxtex/vcpkg.json | 83 | ||||
| -rw-r--r-- | vcpkg/ports/directxtex/xboxusage | 7 |
4 files changed, 241 insertions, 0 deletions
diff --git a/vcpkg/ports/directxtex/portfile.cmake b/vcpkg/ports/directxtex/portfile.cmake new file mode 100644 index 0000000..60558ce --- /dev/null +++ b/vcpkg/ports/directxtex/portfile.cmake @@ -0,0 +1,147 @@ +set(DIRECTXTEX_TAG oct2025) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Microsoft/DirectXTex + REF ${DIRECTXTEX_TAG} + SHA512 8adca6e50dc5da91d2be0c9a644a3372f0c134ec80d71260d72dca79b2422d5eccae844b1b5d0eb4f335548730eb3b1faad4ba7e228f865c7688b60915e70efc + HEAD_REF main +) + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + dx11 BUILD_DX11 + dx12 BUILD_DX12 + jpeg ENABLE_LIBJPEG_SUPPORT + openexr ENABLE_OPENEXR_SUPPORT + png ENABLE_LIBPNG_SUPPORT + spectre ENABLE_SPECTRE_MITIGATION + tools BUILD_TOOLS +) + +set(EXTRA_OPTIONS -DBUILD_SAMPLE=OFF) + +if(VCPKG_TARGET_IS_WINDOWS AND NOT (VCPKG_TARGET_IS_XBOX OR VCPKG_TARGET_IS_MINGW) AND NOT "dx12" IN_LIST FEATURES) + list(APPEND EXTRA_OPTIONS "-DCMAKE_DISABLE_FIND_PACKAGE_directx-headers=TRUE") +endif() + +if(VCPKG_TARGET_IS_MINGW AND ("dx11" IN_LIST FEATURES)) + message(NOTICE "Building ${PORT} for MinGW requires the HLSL Compiler fxc.exe also be in the PATH. See https://aka.ms/windowssdk.") +endif() + +if("xbox" IN_LIST FEATURES) + if((NOT (DEFINED DIRECTXTEX_XBOX_CONSOLE_TARGET)) OR (DIRECTXTEX_XBOX_CONSOLE_TARGET STREQUAL "scarlett")) + list(APPEND FEATURE_OPTIONS "-DBUILD_XBOX_EXTS_SCARLETT=ON") + message(NOTICE "Building ${PORT} with Xbox Series X|S extensions") + elseif(DIRECTXTEX_XBOX_CONSOLE_TARGET STREQUAL "xboxone") + list(APPEND FEATURE_OPTIONS "-DBUILD_XBOX_EXTS_XBOXONE=ON") + message(NOTICE "Building ${PORT} with Xbox One extensions") + else() + message(FATAL_ERROR "The triplet variable DIRECTXTEX_XBOX_CONSOLE_TARGET should be set to 'xboxone' or 'scarlett'.") + endif() +endif() + +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/directxtex) + +if("tools" IN_LIST FEATURES) + + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtex/") + + if((VCPKG_TARGET_ARCHITECTURE STREQUAL x64) AND (NOT (("openexr" IN_LIST FEATURES) OR ("xbox" IN_LIST FEATURES)))) + + vcpkg_download_distfile( + TEXASSEMBLE_EXE + URLS "https://github.com/Microsoft/DirectXTex/releases/download/${DIRECTXTEX_TAG}/texassemble.exe" + FILENAME "texassemble-${DIRECTXTEX_TAG}.exe" + SHA512 d1e8f2959e9a53367a03ded17c49e8720dd8f62cfcde13feeff39ba9b68a5352488ac743c6208f4820b0a94605a8bdce7f2949705d0aba06fb298f93813c2e72 + ) + + vcpkg_download_distfile( + TEXCONV_EXE + URLS "https://github.com/Microsoft/DirectXTex/releases/download/${DIRECTXTEX_TAG}/texconv.exe" + FILENAME "texconv-${DIRECTXTEX_TAG}.exe" + SHA512 de5d4d237a17cac3a3c5c932dcca316e887f7d141353000b343ed7c48f1065bfd232c2f3e748f749b2b4bb1ccb7f731893e28b1227d6bf37ca1ef68c41b1bd00 + ) + + vcpkg_download_distfile( + TEXDIAG_EXE + URLS "https://github.com/Microsoft/DirectXTex/releases/download/${DIRECTXTEX_TAG}/texdiag.exe" + FILENAME "texdiag-${DIRECTXTEX_TAG}.exe" + SHA512 960aeb72e82d4c5fc6388e47ef220062a5e279574338798a32a7b4a3b0bc3bf362272ccd6f8ed6a7fb9674e9ee52f6e2faa022236e6e28dd852445c7b742fecf + ) + + file(INSTALL + "${TEXASSEMBLE_EXE}" + "${TEXCONV_EXE}" + "${TEXDIAG_EXE}" + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtex/") + + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texassemble-${DIRECTXTEX_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texassemble.exe") + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texconv-${DIRECTXTEX_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texconv.exe") + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texdiag-${DIRECTXTEX_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texadiag.exe") + + elseif(((VCPKG_TARGET_ARCHITECTURE STREQUAL arm64) OR (VCPKG_TARGET_ARCHITECTURE STREQUAL arm64ec)) AND (NOT ("openexr" IN_LIST FEATURES))) + + vcpkg_download_distfile( + TEXASSEMBLE_EXE + URLS "https://github.com/Microsoft/DirectXTex/releases/download/${DIRECTXTEX_TAG}/texassemble_arm64.exe" + FILENAME "texassemble-${DIRECTXTEX_TAG}-arm64.exe" + SHA512 9724d9c0b27d4e7b438da99cf304324a94c232d410e18f26ba4dbd3e38495e11b4d03fd63c09c642107afa8529ebb366341e47da0f50fa55b1ec76927adce0ed + ) + + vcpkg_download_distfile( + TEXCONV_EXE + URLS "https://github.com/Microsoft/DirectXTex/releases/download/${DIRECTXTEX_TAG}/texconv_arm64.exe" + FILENAME "texconv-${DIRECTXTEX_TAG}-arm64.exe" + SHA512 d4701b93bae60abb4ad364cde1ce3462c3c39298b1929f0fad188ccc2363b8d25d2f84fb67c259def32dfa2921bc92afae60480ea89c9602e318b91b5c6f3c93 + ) + + vcpkg_download_distfile( + TEXDIAG_EXE + URLS "https://github.com/Microsoft/DirectXTex/releases/download/${DIRECTXTEX_TAG}/texdiag_arm64.exe" + FILENAME "texdiag-${DIRECTXTEX_TAG}-arm64.exe" + SHA512 49134ba643f482b42fe3dd06cbf0b59c899f2d76094f9bea10096aecd70d2641ea06aa94513a7807ffb2ce14126f15bcbcbca98d19d0934e2f5f56ce1ee1197b + ) + + file(INSTALL + "${TEXASSEMBLE_EXE}" + "${TEXCONV_EXE}" + "${TEXDIAG_EXE}" + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/directxtex/") + + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texassemble-${DIRECTXTEX_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texassemble.exe") + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texconv-${DIRECTXTEX_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texconv.exe") + file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texdiag-${DIRECTXTEX_TAG}-arm64.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texadiag.exe") + + elseif("dx11" IN_LIST FEATURES) + + vcpkg_copy_tools( + TOOL_NAMES texassemble texconv texdiag + SEARCH_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin" + ) + + endif() +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") + +if("xbox" IN_LIST FEATURES) + file(READ "${CMAKE_CURRENT_LIST_DIR}/xboxusage" USAGE_CONTENT) + file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" ${USAGE_CONTENT}) +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/directxtex/usage b/vcpkg/ports/directxtex/usage new file mode 100644 index 0000000..525d1f0 --- /dev/null +++ b/vcpkg/ports/directxtex/usage @@ -0,0 +1,4 @@ +The DirectXTex package provides CMake targets:
+
+ find_package(directxtex CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE Microsoft::DirectXTex)
diff --git a/vcpkg/ports/directxtex/vcpkg.json b/vcpkg/ports/directxtex/vcpkg.json new file mode 100644 index 0000000..347ad44 --- /dev/null +++ b/vcpkg/ports/directxtex/vcpkg.json @@ -0,0 +1,83 @@ +{ + "name": "directxtex", + "version-date": "2025-10-27", + "description": "DirectXTex texture processing library", + "homepage": "https://github.com/Microsoft/DirectXTex", + "documentation": "https://github.com/microsoft/DirectXTex/wiki", + "license": "MIT", + "supports": "(windows & !arm32) | linux", + "dependencies": [ + { + "name": "directx-headers", + "platform": "mingw | linux" + }, + "directxmath", + { + "name": "ms-gdkx", + "platform": "xbox" + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + { + "name": "dx11", + "platform": "windows & !xbox" + } + ], + "features": { + "dx11": { + "description": "Build with DirectX11 support", + "supports": "windows & !xbox" + }, + "dx12": { + "description": "Build with DirectX12 support for Windows 10/Windows 11", + "dependencies": [ + { + "name": "directx-headers", + "platform": "windows & !xbox" + } + ] + }, + "jpeg": { + "description": "Add the JPEG auxiliary functions", + "supports": "linux", + "dependencies": [ + "libjpeg-turbo" + ] + }, + "openexr": { + "description": "Enable OpenEXR support", + "dependencies": [ + "openexr" + ] + }, + "png": { + "description": "Add the PNG auxiliary functions", + "supports": "linux", + "dependencies": [ + "libpng" + ] + }, + "spectre": { + "description": "Build Spectre-mitigated library" + }, + "tools": { + "description": "texture command-line tools", + "supports": "windows & !uwp & !xbox" + }, + "xbox": { + "description": "Adds Xbox specific extensions to the library", + "supports": "windows & x64 & !uwp & !xbox", + "dependencies": [ + "ms-gdkx" + ] + } + } +} diff --git a/vcpkg/ports/directxtex/xboxusage b/vcpkg/ports/directxtex/xboxusage new file mode 100644 index 0000000..c0287b2 --- /dev/null +++ b/vcpkg/ports/directxtex/xboxusage @@ -0,0 +1,7 @@ +
+For the 'xbox' feature, it defaults to targeting Xbox Series X|S. To set it to Xbox One,
+create a custom triplet from x64-windows with the addition of the following:
+
+ if (PORT STREQUAL "directxtex")
+ set(DIRECTXTEX_XBOX_CONSOLE_TARGET "xboxone")
+ endif()
|