2021-09-04 07:31:10 +08:00
|
|
|
set(PORT_VERSION 4.0.0)
|
2021-01-11 15:59:25 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO KhronosGroup/KTX-Software
|
|
|
|
REF v${PORT_VERSION}
|
2021-09-04 07:31:10 +08:00
|
|
|
SHA512 49787cf0230939ae0c737f6080ef483dd27ebd653c16525b469b078511ab72e85aecba9bffe71ed45ce1692e8448b845e60545c39f9333e6d216b20f56595faa
|
2021-01-11 15:59:25 +08:00
|
|
|
HEAD_REF master
|
2021-02-19 10:37:43 +08:00
|
|
|
FILE_DISAMBIGUATOR 1
|
2021-01-11 15:59:25 +08:00
|
|
|
PATCHES
|
|
|
|
0001-Use-vcpkg-zstd.patch
|
|
|
|
0002-Fix-versioning.patch
|
|
|
|
)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_acquire_msys(MSYS_ROOT
|
|
|
|
PACKAGES
|
|
|
|
bash
|
|
|
|
DIRECT_PACKAGES
|
|
|
|
# Required for "getopt"
|
|
|
|
"https://repo.msys2.org/msys/x86_64/util-linux-2.35.2-1-x86_64.pkg.tar.zst"
|
|
|
|
ff951c2cd96d0fda87bacb505c93e4aa1f9aeb35f829c52b5a7862d05e167f69605a4927a0e7197b5ee2b2fa5cb56619ad7a6ba293ede4765fdcacedf2ed35da
|
|
|
|
)
|
2022-04-07 05:42:36 +08:00
|
|
|
vcpkg_add_to_path("${MSYS_ROOT}/usr/bin")
|
2022-01-26 02:31:15 +08:00
|
|
|
|
2021-01-11 15:59:25 +08:00
|
|
|
file(REMOVE
|
|
|
|
"${SOURCE_PATH}/other_include/zstd.h"
|
|
|
|
"${SOURCE_PATH}/other_include/zstd_errors.h")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-09-04 07:31:10 +08:00
|
|
|
FEATURES
|
|
|
|
tools KTX_FEATURE_TOOLS
|
|
|
|
vulkan KTX_FEATURE_VULKAN
|
2021-01-11 15:59:25 +08:00
|
|
|
)
|
|
|
|
|
2022-04-07 05:42:36 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-01-11 15:59:25 +08:00
|
|
|
OPTIONS
|
|
|
|
-DKTX_VERSION_FULL=v${PORT_VERSION}
|
|
|
|
-DKTX_FEATURE_TESTS=OFF
|
|
|
|
-DKTX_FEATURE_LOADTEST_APPS=OFF
|
|
|
|
-DKTX_FEATURE_STATIC_LIBRARY=${ENABLE_STATIC}
|
|
|
|
${FEATURE_OPTIONS}
|
2022-04-07 05:42:36 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2021-01-11 15:59:25 +08:00
|
|
|
)
|
|
|
|
|
2022-04-07 05:42:36 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-01-11 15:59:25 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
if(tools IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(
|
|
|
|
TOOL_NAMES
|
|
|
|
toktx
|
|
|
|
ktxsc
|
|
|
|
ktxinfo
|
|
|
|
ktx2ktx2
|
|
|
|
ktx2check
|
|
|
|
AUTO_CLEAN
|
|
|
|
)
|
|
|
|
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
|
|
|
|
endif()
|
|
|
|
|
2022-04-07 05:42:36 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ktx)
|
2021-01-11 15:59:25 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2022-04-07 05:42:36 +08:00
|
|
|
|
|
|
|
if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
|
|
endif()
|
2021-01-11 15:59:25 +08:00
|
|
|
|
|
|
|
configure_file("${SOURCE_PATH}/LICENSE.md" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
|
|
|
|
file(GLOB LICENSE_FILES "${SOURCE_PATH}/LICENSES/*")
|
2022-01-26 02:31:15 +08:00
|
|
|
file(COPY ${LICENSE_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/LICENSES")
|