2020-12-29 09:28:53 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2021-01-13 12:01:37 +08:00
|
|
|
vcpkg_fail_port_install(ON_TARGET "OSX")
|
2020-06-18 05:48:39 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO Microsoft/DirectXTex
|
2021-01-13 12:01:37 +08:00
|
|
|
REF jan2021
|
|
|
|
SHA512 f48f05aea811b2ce04f7e82837ed8da9cd3452d0f582d933dbd8878acdc94d8dfb123fa85f5d483a9cd688d3a129d765514069c6c83c58eb1880f6e5661d61e8
|
2020-06-18 05:48:39 +08:00
|
|
|
HEAD_REF master
|
2021-01-13 12:01:37 +08:00
|
|
|
FILE_DISAMBIGUATOR 1
|
2020-06-18 05:48:39 +08:00
|
|
|
)
|
|
|
|
|
2020-10-14 04:40:52 +08:00
|
|
|
if("openexr" IN_LIST FEATURES)
|
|
|
|
vcpkg_download_distfile(
|
|
|
|
DIRECTXTEX_EXR_HEADER
|
|
|
|
URLS "https://raw.githubusercontent.com/wiki/Microsoft/DirectXTex/DirectXTexEXR.h"
|
|
|
|
FILENAME "DirectXTexEXR.h"
|
|
|
|
SHA512 94ec71069949c8daa616d241ade0c771c448adab3e401a935d5462e7cac382cfbef47534072fc4b9706e086f5021de78a51fd4e2a6850cd3629c932592f9a168
|
|
|
|
)
|
2020-06-18 05:48:39 +08:00
|
|
|
|
2020-10-14 04:40:52 +08:00
|
|
|
vcpkg_download_distfile(
|
|
|
|
DIRECTXTEX_EXR_SOURCE
|
|
|
|
URLS "https://raw.githubusercontent.com/wiki/Microsoft/DirectXTex/DirectXTexEXR.cpp"
|
2021-01-13 12:01:37 +08:00
|
|
|
FILENAME "DirectXTexEXR-1.cpp"
|
|
|
|
SHA512 770fc0325b49139079b0bceb50619f93887e87a3dcf264b10dc01be16209fa51ba03d8273d4d4f84e596ac014376db96b7fed0afabe08c32394ed92495168ea6
|
2020-10-14 04:40:52 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(COPY ${DIRECTXTEX_EXR_HEADER} DESTINATION ${SOURCE_PATH}/DirectXTex)
|
|
|
|
file(COPY ${DIRECTXTEX_EXR_SOURCE} DESTINATION ${SOURCE_PATH}/DirectXTex)
|
2021-01-13 12:01:37 +08:00
|
|
|
file(RENAME ${SOURCE_PATH}/DirectXTex/DirectXTexEXR-1.cpp ${SOURCE_PATH}/DirectXTex/DirectXTexEXR.cpp)
|
2020-10-14 04:40:52 +08:00
|
|
|
vcpkg_apply_patches(SOURCE_PATH ${SOURCE_PATH} PATCHES enable_openexr_support.patch)
|
2020-06-18 05:48:39 +08:00
|
|
|
endif()
|
|
|
|
|
2020-10-14 04:40:52 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2020-10-23 15:35:28 +08:00
|
|
|
FEATURES
|
|
|
|
dx12 BUILD_DX12
|
|
|
|
openexr ENABLE_OPENEXR_SUPPORT
|
2020-10-14 04:40:52 +08:00
|
|
|
)
|
|
|
|
|
2021-01-13 12:01:37 +08:00
|
|
|
if (VCPKG_HOST_IS_LINUX)
|
|
|
|
message(WARNING "Build ${PORT} requires GCC version 9 or later")
|
|
|
|
endif()
|
|
|
|
|
2020-12-29 09:28:53 +08:00
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
|
|
set(EXTRA_OPTIONS -DBUILD_TOOLS=OFF)
|
|
|
|
else()
|
|
|
|
set(EXTRA_OPTIONS -DBUILD_TOOLS=ON)
|
|
|
|
endif()
|
|
|
|
|
2020-10-14 04:40:52 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
PREFER_NINJA
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-12-29 09:28:53 +08:00
|
|
|
${EXTRA_OPTIONS}
|
2020-10-14 04:40:52 +08:00
|
|
|
-DBC_USE_OPENMP=ON
|
|
|
|
-DBUILD_DX11=ON
|
2020-06-18 05:48:39 +08:00
|
|
|
)
|
|
|
|
|
2020-12-29 09:28:53 +08:00
|
|
|
vcpkg_install_cmake()
|
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
|
2020-10-14 04:40:52 +08:00
|
|
|
|
2021-01-13 12:01:37 +08:00
|
|
|
if((VCPKG_TARGET_IS_WINDOWS) AND (NOT VCPKG_TARGET_IS_UWP))
|
2020-10-14 04:40:52 +08:00
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES texassemble texconv texdiag
|
|
|
|
SEARCH_DIR ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/bin/CMake
|
|
|
|
)
|
2020-12-29 09:28:53 +08:00
|
|
|
|
|
|
|
elseif((VCPKG_HOST_IS_WINDOWS) AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64))
|
|
|
|
vcpkg_download_distfile(texassemble
|
2021-01-13 12:01:37 +08:00
|
|
|
URLS "https://github.com/Microsoft/DirectXTex/releases/download/jan2021/texassemble.exe"
|
2020-12-29 09:28:53 +08:00
|
|
|
FILENAME "texassemble.exe"
|
2021-01-13 12:01:37 +08:00
|
|
|
SHA512 0def8873358234ea4cd16acd59cb1dda2a8ad132f362502d643caed43e9aef19f9c7e7248494093cbd61e7501a9b44f545d3fbd5f50972ebcee3d01598a7c3b7
|
2020-12-29 09:28:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_download_distfile(texconv
|
2021-01-13 12:01:37 +08:00
|
|
|
URLS "https://github.com/Microsoft/DirectXTex/releases/download/jan2021/texconv.exe"
|
2020-12-29 09:28:53 +08:00
|
|
|
FILENAME "texconv.exe"
|
2021-01-13 12:01:37 +08:00
|
|
|
SHA512 77559db65406ad0343901ff22f7647c4f270674f7b0c31b12d8dc26c718f410708ebe95bdc0ddba4049fa6cefd52ff856174530fc4170f9e725b30aacb78249c
|
2020-12-29 09:28:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_download_distfile(texdiag
|
2021-01-13 12:01:37 +08:00
|
|
|
URLS "https://github.com/Microsoft/DirectXTex/releases/download/jan2021/texdiag.exe"
|
2020-12-29 09:28:53 +08:00
|
|
|
FILENAME "texdiag.exe"
|
2021-01-13 12:01:37 +08:00
|
|
|
SHA512 1b9e733050b5f92af86a9a2f415205acbff62f0708e491a3846d7b6e480a9c57086eff636be163d42a40a6d34dafc622cc53940797e7f6f77e739f3a66365f57
|
2020-12-29 09:28:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtex/")
|
|
|
|
|
|
|
|
file(INSTALL
|
|
|
|
${DOWNLOADS}/texassemble.exe
|
|
|
|
${DOWNLOADS}/texconv.exe
|
|
|
|
${DOWNLOADS}/texdiag.exe
|
|
|
|
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/directxtex/)
|
2020-06-18 05:48:39 +08:00
|
|
|
endif()
|
|
|
|
|
2020-12-29 09:28:53 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
2020-06-18 05:48:39 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|